function addEvent( obj, type, fn ) {
  if ( obj.attachEvent ) {
    obj['e'+type+fn] = fn;
    obj[type+fn] = function(){obj['e'+type+fn]( window.event );}
    obj.attachEvent( 'on'+type, obj[type+fn] );
  } else
    obj.addEventListener( type, fn, false );
}
function removeEvent( obj, type, fn ) {
  if ( obj.detachEvent ) {
    obj.detachEvent( 'on'+type, obj[type+fn] );
    obj[type+fn] = null;
  } else
    obj.removeEventListener( type, fn, false );
}
function getQuerystring(key, default_)
{
  if (default_==null) default_="";
  key = key.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
  var regex = new RegExp("[\\?&]"+key+"=([^&#]*)");
  var qs = regex.exec(window.location.href);
  if(qs == null)
    return default_;
  else
    return qs[1];
}
function map(){
	if(document.getElementById("map"))
	{
		var latlng = new google.maps.LatLng(53.377684, -1.508045);
		var myOptions = {
		  zoom: 16,
		  center: latlng,
		  mapTypeId: google.maps.MapTypeId.ROADMAP
		};
		var map = new google.maps.Map(document.getElementById("map"), myOptions);
	}
}
function quote(){
	if(document.getElementById("raq-commercial")){
		var type = getQuerystring("type");
		if(type=="commercial"){
			document.getElementById("raq-commercial").style.display="block";
		}
		else if(type=="personal"){
			document.getElementById("raq-personal").style.display="block";
		}
	}
}

addEvent(window,'load',map);
addEvent(window,'load',quote);

$(document).ready(function(){
						   $(".urlfield input").val(window.location);
						   $(".send2friend a").click(function(){
															  if($("#SendToFriend:visible").length>0){
																$("#SendToFriend").fadeOut();  
															  }
															  else{
																$("#SendToFriend").fadeIn();  
															  }
															  });
						   										return false;
						   });
