function sendRequest() {
	dtcheck1 = $.datepicker.parseDate('dd/mm/yy', $('#pickupdate').val() );dtcheck1.setHours($('#Phour').val());
	dtcheck2 = $.datepicker.parseDate('dd/mm/yy', $('#returndate').val() );dtcheck2.setHours($('#Rhour').val());
	count = (dtcheck2 - dtcheck1) / 1000 / 3600 / 24;
	if (count <= 3){
		$("<div id='warning' class='ui-corner-all'><strong style='font-size:14px'>Contact Us for less than 4-Days rentals</strong><br>Call Now: +30 2810 240120<br>or visit the <a href='contact.html'>Contact Us</a> page<br><span style='display:block; font-size:9px; paddding:10px;'>Closing in <span id='cntr'>5</span> secs</span></div>").insertBefore($('#superbox')).hide();
		$("#warning").slideDown("slow").delay(5000).slideUp("slow", function(){ $(this).remove();clearInterval(myInterval);});
		counter=5;var myInterval = setInterval(function () {counter--;$("#cntr").text(counter);},1000);return false;
	} 
	if ( dtcheck1 < new Date(jQuery.myDate.today) ){
		$("<div id='warning' class='ui-corner-all'><strong style='font-size:14px'>Please select Pick Up date later than today</strong><br><span style='display:block; font-size:9px; paddding:10px;'>Closing in <span id='cntr'>5</span> secs</span></div>").insertBefore($('#superbox')).hide();
		$("#warning").slideDown("slow").delay(5000).slideUp("slow", function(){ $(this).remove();clearInterval(myInterval);});
		counter=5;var myInterval = setInterval(function () {counter--;$("#cntr").text(counter);},1000);return false;
	}
	loading(true);
	var pup = $("#pickup").val().split("_").join(" ");var rep = $("#retur").val().split("_").join(" ");var pud = $("#pickupdate").val();var red = $("#returndate").val();var puh = $("#Phour").val();var reh = $("#Rhour").val();var ref = "RCC";
	var puparea = document.getElementById("pickup").options[document.getElementById("pickup").selectedIndex].parentNode.label;
	var reparea = document.getElementById("retur").options[document.getElementById("retur").selectedIndex].parentNode.label;
	_gaq.push(['b._setAccount', 'UA-333779-1']);
	_gaq.push(['b._setDomainName', 'none']);
	_gaq.push(['b._setAllowHash', false]);
	_gaq.push(['b._trackEvent', dtcheck1.getTime()+' ='+ document.getElementById("pickupdate").value, puparea, document.getElementById("pickup").value.split("_").join(" "),count]);
	$.ajax({
 	    timeout:15000,
		type: 'GET',
		url: "http://www.justrentals.gr/engine/reserver.php",
		data: "pup="+pup+"&puparea="+puparea+"&rep="+rep+"&reparea="+reparea+"&pud="+pud+"&red="+red+"&puh="+puh+"&reh="+reh+"&ref="+ref,
		success: handleResponse,
		error:function(a,b,c){loading(false);$("<div id='warning' class='ui-corner-all'><strong style='font-size:14px'>Error "+b+", Please try again later!</strong><br><span style='display:block; font-size:9px; paddding:10px;'>Closing in <span id='cntr'>10</span> secs</span></div>").insertBefore($('#superbox')).hide();$("#warning").slideDown("slow").delay(10000).slideUp("slow", function(){ $(this).remove();clearInterval(myInterval);});counter=10;var myInterval = setInterval(function () {counter--;$("#cntr").text(counter);},1000);return false;},
		dataType: "xml"
	});
}
function handleResponse(data){
		jQuery.mydata = data;
		//alert(geoip_country_code());
    	var response = data;
		days = $(response).find('Days').text();
		pup = $(response).find('PickupPlace').text();
		rep = $(response).find('ReturnPlace').text();
		pud = $(response).find('PickupDate').text();
		red = $(response).find('ReturnDate').text();
		// write out response
	  $("#carboxes").empty();
	  $("#carboxes").append("<div id='infobox'><div><div id='pickupFD' class='ui-corner-bottom'><div class='restarthd'>Pick up</div><div id='pickuptext'></div></div><div id='returnFD' class='ui-corner-bottom'><div class='restarthd'>Return</div><div id='returntext'></div></div><div id='editdiv'><button type='button' id='restart' name='restart' class='ui-corner-all ui-state-active'>Change Details</button><br /><select id='currencyfilter2' name='currencyfilter2' class='ui-corner-all'><option value='EUR' selected>(&euro;) Euro</option><option value='GBP'>(&pound;) GB Pound</option><option value='USD'>($) US Dollar</option></select><div id='couponinactive'><input id='couponcb' type='checkbox'><label for='couponcb'>i have a coupon code</label></div><div id='couponactive' style='display:none;'><input id='coupon' type='text' value='COUPON?' maxlength='7' style='' class='ui-corner-all'><button type='button' id='couponok' class='ui-corner-all ui-state-active' style=''>check it</button></div></div><div id='filterdiv'><div class='ui-corner-top'><input type='checkbox' class='filters' id='all' checked='checked' /><label for='all'>Show All</label><input type='checkbox' class='filters' id='manual' checked='checked' /><label for='manual'>Manual </label><input type='checkbox' class='filters' id='automatic' checked='checked' /><label for='automatic'>Automatic</label><input type='checkbox' class='filters' id='bus' checked='checked'/><label for='bus'>Busses / Vans</label><input type='checkbox' class='filters' id='4x4' checked='checked' /><label for='4x4'>4x4 / Convertibles</label></div></div></div></div>");
	  	
		$('#couponcb').bind("click",function(event, ui) {changeto("EUR");$("#couponinactive").slideUp('slow');$("#couponactive").slideDown('slow');$(".tipsy").fadeOut('slow');$("#currencyfilter2").attr("disabled","disabled");});
		$('#currencyfilter2').bind("change",function(event, ui) {	changeto($(this).val());	});
	  	$('#coupon').bind('click', function(){if($(this).val()=="COUPON?"){$(this).val("");}});
	  	$('#couponok').bind('click', function(){
			if($("#coupon").val()=="COUPON?"){$("#coupon").val("")};
			loading(true);
			$.ajax({
				type: 'GET',
				url: "http://www.justrentals.gr/coupons.php",
				data: "coupon="+$("#coupon").val()+"&pup="+$("#pickupdate").val() ,
				success: function(msg){
						if (msg=="FAIL"){$.colorbox({ html: "<div id='mydialog'>Your coupon code is wrong!</div>",transition: 'elastic',iframe:false,opacity: 0.65,innerWidth: 550,height: 170,scrolling:false,onLoad: function(){$('#cboxWrapper').show();}});
						}else if(msg=="ERROR"){$.colorbox({html: "<div id='mydialog'>Your coupon code is not eligible<br>for the selected pick up date!</div>",transition: 'elastic',iframe:false,opacity: 0.65,innerWidth: 550,height: 170,scrolling:false,onLoad: function(){$('#cboxWrapper').show();}});}
						else{
							var curr = $('#group1').find(".poadaily").html().substr(0,1);
							$("#currencyfilter2").attr("disabled","disabled");
							$(".savebtn").fadeOut('slow');
							var ds = msg.split(' ');
							$("#couponok").slideUp("fast");
							$("#coupon").val( '*'+$("#coupon").val()+'*'	);
							$("#coupon").slideUp('fast', function(){$("#coupon").after("<div id='succdis'><img src='images/check_m.gif' width='12' height='9'> Coupon Applied!</div>").delay(1000);});
							$('[id^="group"]').each(function(){
														 $(this).find(".predaily").fadeOut('fast').html( curr+($(this).find(".predaily").html().substr(1) * ds[1] ).toFixed(2) ).fadeIn('slow');
														 $(this).find(".pretotal").fadeOut('fast').html( "total: "+curr+" "+($(this).find(".pretotal").html().substr(8) * ds[1] ).toFixed(0) ).fadeIn('slow');
														 $(this).find(".poadaily").fadeOut('fast').html( curr+($(this).find(".poadaily").html().substr(1) * ds[0] ).toFixed(2) ).fadeIn('slow');
														 $(this).find(".poatotal").fadeOut('fast').html( "total: "+curr+" "+($(this).find(".poatotal").html().substr(8) * ds[0] ).toFixed(0) ).fadeIn('slow');
				 		});						
							loading(false);
						}},dataType: "text"
			});	   
		});
	  	$('.filters').bind('click', function(){
											 loading(true);
											 if( $(this).attr('id')=="manual" ){
											 $myfilter = $("#group0, #group1, #group2, #group3, #group4, #group5, #group6, #group7, #group8, #group9, #group14, #group15");				
											 }else if( $(this).attr('id')=="automatic" ){
												 $myfilter = $("#group10, #group11, #group12, #group13, #group16, #group17");
											 }else if( $(this).attr('id')=="bus" ){
												 $myfilter = $("#group8, #group9");
											 }else if( $(this).attr('id')=="4x4" ){
												 $myfilter = $("#group6, #group7, #group14, #group15, #group16, #group17");
											 }else{
												 $myfilter = $(".caritem");
											 }
		
												$(this).attr('checked',true);
							                    $(".filters:not(#" + this.id + ")").removeAttr('checked');
												if($(this).attr('id')=="all"){
													$(".filters").attr('checked',true);
												}
												
												$(".caritem").fadeOut('fast');
												$(".notavailable").fadeOut('fast');
												$myfilter.each(function(index, value) { 
													 if(	$(this).prev().hasClass("notavailable")	){
														 $(this).prev().fadeIn('slow');
													 }
												});
												$myfilter.fadeIn('slow');
											loading(false);
											});
	  $("#pickuptext").append(pup+", <br> "+pud );
      $("#returntext").append(rep+", <br> "+red );		
	  $("#restart").bind('click', function(){
		$('#superbox input, #superbox select, #superbox label').fadeIn('slow');
		$('#carboxes').slideUp('slow',function(){$(this).empty();});
		$('#superbox').slideDown('slow');
	  });
	  $(response).find('Group').each(function(){	
			var newprice = $(this).find('Price').text();
	  		$id = $(this).attr('id');
			$state = $(this).find('Av').text();	
			$discount = (100 - $(this).find('Discount').text()) / 100;
			$dPrice = ( newprice / days ).toFixed(2);
			$dDprice = ( newprice * $discount).toFixed(0);
			$tDprice = ( (newprice * $discount)/days ).toFixed(2);
			$("#carboxes").append("<div class='ui-dialog ui-widget ui-widget-content ui-corner-all caritem' id='group"+$id+"'> <div class='ui-dialog-titlebar ui-widget-header ui-corner-top ui-helper-clearfix'> <span class='ui-dialog-title caritemtitle'>Group "+$(this).find('Gname').text()+"</span> </div> <div class='ui-dialog-content ui-widget-content caritemcontent' scrolltop='0' scrollleft='0'> <div class='caritempricediv'> <div class='caritempricecont'> <div class='caritempricepre'> <div class='caritempricetitle'>Prepay<br />now</div> <div class='predaily'>&euro;"+ $tDprice +"</div> <div class='pretotal'>total: &euro; "+ $dDprice +"</div> </div> <div class='caritempricepoa'> <div class='caritempricetitle'>Pay at<br />location</div> <div class='poadaily'>&euro;"+$dPrice+"</div> <div class='poatotal'>total: &euro; "+ newprice +"</div> </div> </div> </div> <span class='ui-corner-all caritemimg'><img src='"+$(this).find('Gimg').text()+"' width='92' height='48' border='0' onclick='moreinfo("+$id+")'></span> <p class='caritemmodels'>"+$(this).find('Gmodels').text()+"</p> <p class='caritemchars'>"+$(this).find('Gmotor').text()+"cc, "+$(this).find('Gdoors').text()+"-Doors, "+$(this).find('Gseats').text()+"-Passengers, Air-Condition, "+$(this).find('Gtrans').text()+" Gearbox, "+$(this).find('Gbags').text()+" luggages <span onclick='moreinfo("+$id+")'>more info</span></p> <p class='allin' onclick='moreinfo("+$id+")'><img src='http://www.rental-center-crete.com/images/quoteok.gif' alt='ok' width='16' height='16' align='absbottom'> ALL INCLUSIVE PACKAGE <img src='http://www.rental-center-crete.com/images/quoteinfo.gif' alt='ok' width='16' height='16' align='absbottom'></p> </div> <div class='ui-dialog-buttonpane ui-widget-content ui-helper-clearfix'> <div id='socialbar"+$id+"' class='socialbar'></div> <div class='ui-dialog-buttonset'> <button type='button' class='ui-button ui-state-error ui-corner-right ui-button-text-only bookbtn'><span class='ui-button-text'>Book this offer</span></button> <div class='ui-button ui-state-highlight ui-corner-left ui-button-text-only savebtn'><span class='ui-button-text'>Save Quote</span></div> </div> </div> </div>");
			$("#socialbar" + $id).append( $('.socialdiv').html() );
			$("#socialbar" + $id).fadeIn('slow');
			if($state==0){$("#group" + $id).before("<div class='notavailable'></div>");}
	  });
	  	$(".socialbar li").tipsy({html: true, gravity: $.fn.tipsy.autoNS });
		$(".socialbar li, .allin").bind("click",function(event, ui) { moreinfo('full');  });		
		$("#currencyfilter2").tipsy({html:true, delayOut: 1000, trigger: 'focus',gravity: 'e', fallback:'GBP &pound; and USD $ prices are advertised only for informational reasons!<br><b>Booking will be placed in Euros!</b>' });
		$("#couponinactive").tipsy({html:true, delayOut: 1000, trigger: 'focus',gravity: 'e', fallback:'The currency will<br>be set to <b>EURO</b>!' });
		$(".caritempricepre").tipsy({html:true, trigger: 'hover',gravity: 'e', fallback:'Prepay for the rental cost at time of booking and get it on cheaper rates' });
		$(".caritempricepoa").tipsy({html:true, trigger: 'hover',gravity: 'e', fallback:'Pay for the rental cost at the rental location in cash or credit card' });
		$(".savebtn").hover(function(){	$(this).html("<span class='ui-button-text' style='width: 89px;'><span class='savebtns fbbtn' title='Post to your Facebook wall'></span> <span class='savebtns twbtn' title='Tweet it'></span> <span class='savebtns mlbtn' title='Send this by e-mail'></span> <span class='savebtns qrbtn' title='Send it to your mobile phone with QR Code'></span></span>");
		$(".savebtns").bind("click",function(){
													myselected = $(this).parent().parent().parent().parent().parent();
													var newurl = "http://www.justrentals.gr/reservation.html?PUP="+pup.split(" ").join("_")+"&REP="+rep.split(" ").join("_")+"&PUD="+$('#pickupdate').val()+"&RED="+$('#returndate').val()+"&PUH="+$('#Phour').val()+"&REH="+$('#Rhour').val()+"&ST=1&HL="+myselected.attr('id').substr(5);
													if(	$(this).hasClass("fbbtn") ){
			desc = "JustRentals.gr just quoted me a " + myselected.find(".caritemtitle").text() + " ("+myselected.find(".caritemmodels").text()+") car rental in " + pup + " from "+ $('#pickupdate').val() +" to " + $('#returndate').val() + " at the lowest price of "+myselected.find(".predaily").text()+" per day! The price is all inclusive without any hidden costs! check it out http://www.justrentals.gr !"
			t=encodeURIComponent('Crete Car Rental offer: '+myselected.find(".caritemtitle").text() +' from '+ myselected.find(".predaily").text() +' per day by JustRentals.gr');
    		d=encodeURIComponent(desc);
			u=encodeURIComponent(newurl);
			i=encodeURIComponent('http://www.justrentals.gr/images/voucher-logo.jpg');
			share_url='http://www.facebook.com/sharer.php';
			share_url+='?s=100&p[title]='+t+'&p[summary]='+d+'&p[url]='+u;
			share_url+='&p[images][0]='+i;
			share_url+='&t='+t+'&e='+d;
			popup(share_url,626,436);
			}
													else if( $(this).hasClass("twbtn") ){
														var username="anaplas"; // bit.ly username
														var key="R_20caab95fc34c67249cb89ef41dea0a6";
														$.ajax({
															url:"http://api.bit.ly/v3/shorten",
															data:{longUrl:newurl,apiKey:key,login:username},
															dataType:"jsonp",
															async: false,
															success:function(v){
																bit_url1 =v.data.url;
																var share_url='http://twitter.com/home?status=';
														share_url+= encodeURIComponent("@car_hire_crete quoted me #car_rental for my #travel to #crete at the price of "+myselected.find(".predaily").text()+" per day! Check it out: ");
														share_url += bit_url1+' ';
																popup(share_url,750,350);
															}
														});
													}
													else if( $(this).hasClass("qrbtn") ){
														$.colorbox({ 
														   transition: 'elastic',
														   iframe:true,
														   opacity: 0.85,
														   innerWidth: 325,
														   innerHeight: 325,
														   scrolling:false,
														   title:"<div style='display: block;font: 12px tahoma;text-align: left;color:black;padding: 0 15px;'>Scan this image with your mobile, in order to view this page later, on your mobile phone!</div>",
														   href: "http://qrcode.kaywa.com/img.php?s=5&d="+encodeURIComponent(newurl),
														   onLoad: function(){
															   $('#cboxWrapper').show();
															   }
														});

													}
													else{													
													var content3 = "http://www.rental-center-crete.com/publish3.php?id="+myselected.attr('id').substr(5);
													content3 += "&group="+encodeURIComponent( myselected.find(".caritemtitle").text() );
													content3 += "&pup="+encodeURIComponent(pup.split(" ").join("_"));
													content3 += "&rep="+encodeURIComponent(rep.split(" ").join("_"));
													content3 += "&pud="+encodeURIComponent($('#pickupdate').val());
													content3 += "&red="+encodeURIComponent($('#returndate').val());
													content3 += "&puh="+encodeURIComponent($('#Phour').val());
													content3 += "&reh="+encodeURIComponent($('#Rhour').val());
													content3 += "&days="+encodeURIComponent(days);
													content3 += "&hl=jrt";
													content3 += "&cur="+encodeURIComponent( $("#currencyfilter2").val() );
													content3 += "&daily="+encodeURIComponent( myselected.find(".predaily").text() );
													content3 += "&pre="+encodeURIComponent( myselected.find(".pretotal").text().substr(8) );
													content3 += "&poa="+encodeURIComponent( myselected.find(".poatotal").text().substr(8) );

														$.colorbox({ 
														   transition: 'elastic',
														   iframe:true,
														   opacity: 0.85,
														   innerWidth: 550,
														   innerHeight: 170,
														   scrolling:false,
														   href: content3,
														   onLoad: function(){
															   $('#cboxWrapper').show();
															   }
														});
													}});},
							function(){ $(this).html("<span class='ui-button-text' style='width: 89px;'>Save Quote</span>");});
		$(".bookbtn").bind("click",function(event, ui){
				loading(true);
				var myselectid = $(this).parent().parent().parent().attr('id');
				var data=[$(this).parent().parent().parent().find(".pretotal").text().substr(8),$(this).parent().parent().parent().find(".poatotal").text().substr(8),$("#currencyfilter").val(), $("#coupon").val(), myselectid.substr(5) ];	
				$('#carboxes').fadeOut('slow');
				changeto('EUR');
				//$('#carboxes').fadeOut('slow');	
				$('#carboxes').fadeOut('slow');
				var myselect = $('#'+myselectid);
				data.unshift( myselect.find(".pretotal").text().substr(8), myselect.find(".poatotal").text().substr(8), myselect.find(".caritemtitle").text(), pup, pud, $("#pickupdate").val(), $('#Phour').val(), rep, red, $("#returndate").val(), $('#Rhour').val(), days, Math.round(((new Date()).getTime()-Date.UTC(1970,0,1))/1000) );
				$('#hiddenfrm').append("<form id='fnlfrm2' method='post' action='confirm.php'></form>");
				$.each( data , function(i, value) {$('#fnlfrm2').append("<input name=vals[] value='" + value + "' type='hidden'>");});
				$('#fnlfrm2').submit();
				//loading(false);
		});
		if( $("#currencyfilter").val()!="EUR"){	changeto($("#currencyfilter").val());}
		if( $("#carfilter").val()!="all"){	
			if(	$("#carfilter").val() =='Manual'){	$("#manual").click();	$("#manual").attr("checked",true);	}
			else if(	$("#carfilter").val() =='Auto'){	$("#automatic").click();	$("#automatic").attr("checked",true);	}
			else if(	$("#carfilter").val() =='Bus'){	$("#bus").click();	$("#bus").attr("checked",true);	}
			else if(	$("#carfilter").val() =='Jeeps'){	$("#4x4").click();	$("#4x4").attr("checked",true);	}
		}
		$('#superbox input, #superbox select, #superbox label').fadeOut('fast');
		$('#superbox').slideUp('slow');
		$('#carboxes').slideDown('slow');	 
		if(getQuerystring('HL').length > 0) {
			var chap = 237 + 200 + getQuerystring('HL') * (179 + 25);
        	$('html,body').animate({scrollTop : chap},'slow');
			$("#blackon").fadeTo("slow", 0.35);
			$("#group" + getQuerystring('HL')).css('position', 'relative');
			$("#group" + getQuerystring('HL')).css('z-index', 4000);		
			$("#blackon").fadeOut(2500);
		}else{
        	$('html,body').animate({scrollTop : 311},'slow');
		}
	    loading(false);
}
function moreinfo(i){
	var content = "moreinfo.php?id="+i;
	$.colorbox({transition: 'elastic',iframe:true,opacity: 0.75,innerWidth: 730, height: '90%', scrolling:false, href: content,onLoad: function(){$('#cboxWrapper').show();}});
}
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 fixBridge(){
	var flg = false;
	if(getQuerystring('PUP').length > 0) {document.onlinequote.pickup.value=getQuerystring('PUP'); flg=true;}
	if(getQuerystring('REP').length > 0) {document.onlinequote.retur.value=getQuerystring('REP'); flg=true;}
	if(getQuerystring('PUD').length > 0) {document.onlinequote.pickupdate.value=decodeURIComponent(getQuerystring('PUD')); flg=true;}
	else{fix_dfields()}
	if(getQuerystring('RED').length > 0) {document.onlinequote.returndate.value=decodeURIComponent(getQuerystring('RED')); flg=true;}
	if(getQuerystring('PUH').length > 0) {document.onlinequote.Phour.value=getQuerystring('PUH'); flg=true;}
	if(getQuerystring('REH').length > 0) {document.onlinequote.Rhour.value=getQuerystring('REH'); flg=true;}
	if(getQuerystring('ST')==1) {sendRequest();}
	return true;
}
function fix_dfields(){       
	var today = new Date(jQuery.myDate.today);
	today.setDate(today.getDate()+1);
	$('#pickupdate').datepicker("setDate", today);
	today.setDate(today.getDate()+7);
	$('#returndate').datepicker("setDate", today);
}
function fix_dates(){if (!fixBridge()){fix_dfields();}}
function changeto(curto){
			loading(true);
			if(	$("#currencyfilter2").val()!='EUR'	){$("#currencyfilter").val("EUR").attr('selected',true); handleResponse($.mydata);}
			if( curto =="GBP"){$("#currencyfilter2").val("GBP").attr('selected',true);$("#currencyfilter").val("GBP").attr('selected',true);$rate= jQuery.gbprate ;$curicon="&pound;";
			}else if(curto=="USD"){$rate=jQuery.usdrate;$("#currencyfilter2").val("USD").attr('selected',true);	$("#currencyfilter").val("USD").attr('selected',true);$curicon="$";
			}else if(curto=="EUR"){	$("#currencyfilter").val("EUR").attr('selected',true); handleResponse($.mydata);$rate=1; $("#currencyfilter2").val("EUR").attr('selected',true);$curicon="&euro;";
			}
			  $(".predaily").each(function(){ $(this).html(	$curicon+($(this).text().substring(1) * $rate).toFixed(2)	);	});
			  $(".pretotal").each(function(){ $(this).html(	"total: "+$curicon+ ($(this).text().substr(8) * $rate).toFixed(0)	);	});
			  $(".poadaily").each(function(){ $(this).html(	$curicon+($(this).text().substring(1) * $rate).toFixed(2)	);	});
			  $(".poatotal").each(function(){ $(this).html(	"total: "+$curicon+ ($(this).text().substr(8) * $rate).toFixed(0)	);	});
			loading(false);
}
function popup(url, vwidth,vheight){
 var width  = vwidth; var height = vheight; var left   = (screen.width  - width)/2;
 var top    = (screen.height - height)/2; var params = 'width='+width+', height='+height; params += ', top='+top+', left='+left; params += ', directories=no'; params += ', location=no'; params += ', menubar=no'; params += ', resizable=no'; params += ', scrollbars=no'; params += ', status=no'; params += ', toolbar=no'; newwin=window.open(url,'sharer', params); if (window.focus) {newwin.focus()} return false;
}
function loading(o){
	if(o){ if(	$(".preloader").length ){}else{$("#cboxOverlay").css({'display':'block','opacity':'0.5'}).prepend("<img id='preloadimg' src='http://www.rental-center-crete.com/images/loader.gif' style='margin:245px auto;' class='preloader' />");}
	}else{	$("#cboxOverlay").delay(500).fadeOut('fast', function() {$(".preloader").remove();});}
}
