function get_id ($id) {
		if (document.all && document.getElementById) {
			return document.all($id);
		} else if (!document.all && document.getElementById) {
			return document.getElementById($id);
		} else {
			return false;
		}
	}

function sendtestmail(id){

	location.href="sendtestmail.php?id=" + id;

}

function sendtestmail36(id){

	location.href="sendtestmail36.php?id=" + id;

}




function newsletter(id){

	document.getElementById("afsend_" + id).style.visibility = 'hidden';
	var x=event.x+document.body.scrollLeft + 20;
	var y=event.y+document.body.scrollTop + 40;
	window.open("sendmaildialog.php?id=" + id ,"test","left=" + x + ", top=" + y + " , toolbars=no,location=no,status=no,scrollbars=no,width=150, height=150");


	//location.href="sendmail.php?id=" + id;

}
	
function hidediv (id,img) {
	if (($id = get_id(id))) {
		if ($id.style.display == 'none') {
			$id.style.visibility = 'visible';
			$id.style.display = 'block';
			$img = get_id(img);
			$img.src = "img/minus.gif";
		} else {
			$id.style.visibility = 'hidden';
			$id.style.display = 'none';
			$img = get_id(img);
			$img.src = "img/plus.gif";
		}
	}
}


function enquiryTabOpen(epocdate){

	dateval=epocdate.split("$");

	for(var i=0;i<dateval.length;i++){
	
		if(i==0){
			monthstr = dateval[i];
		}else if(i==1){
			datestr = dateval[i];		
		}else if(i==2){	
			yearstr = dateval[i];		
		}
	}


	if(monthstr==1){
		monthstr="01";		
	}else if(monthstr==2){	
		monthstr="02";
	}else if(monthstr==3){
		monthstr="03";	
	}else if(monthstr==4){
		monthstr="04";	
	}else if(monthstr==5){
		monthstr="05";	
	}else if(monthstr==6){
		monthstr="06";	
	}else if(monthstr==7){
		monthstr="07";	
	}else if(monthstr==8){
		monthstr="08";	
	}else if(monthstr==9){
		monthstr="09";	
	}

	if(datestr==1){
		datestr="01";		
	}else if(datestr==2){	
		datestr="02";
	}else if(datestr==3){
		datestr="03";	
	}else if(datestr==4){
		datestr="04";	
	}else if(datestr==5){
		datestr="05";	
	}else if(datestr==6){
		datestr="06";	
	}else if(datestr==7){
		datestr="07";	
	}else if(datestr==8){
		datestr="08";	
	}else if(datestr==9){
		datestr="09";	
	}

	id = get_id('day');
	id.value=datestr;

	id = get_id('month');
	id.value=monthstr;

	id = get_id('year');
	id.value=yearstr;


	$id = get_id('tab4');
	$id.style.visibility = 'visible';
	$id.style.display = 'block';
	$id = get_id('tab3');
	$id.style.visibility = 'hidden';
	$id.style.display = 'none';


	id1 = get_id("tab1but");
	id1.className = 'tab_not_sel';
	id2 = get_id("tab2but");
	id2.className = 'tab_sel_del_left_not_selected';
	id3 = get_id("tab3but");
	id3.className = 'tab_not_sel';
	id4 = get_id("tab4but");
	id4.className = 'tab_sel_del_left_not_selected';
	id5 = get_id("tab5but");
	id5.className = 'tab_not_sel';
	id6 = get_id("tab6but");
	id6.className = 'tab_sel_del_right_selected';
	id7 = get_id("tab7but");
	id7.className = 'tab_sel';
	id8 = get_id("tab8but");
	id8.className = 'tab_sel_del_left_selected';
	id9 = get_id("tab9but");
	id9.className = 'tab_not_sel';
	id10 = get_id("tab10but");
	id10.className = 'tab_sel_del_left_not_selected';
	id11 = get_id("tab11but");
	id11.className = 'tab_not_sel';
	id12 = get_id("tab12but");
	id12.className = 'tab_sel_right_not_selected';

}

function enquiryTabOpenExternal(prop){

location.href="../../../property.php/all/2/" + prop;

/*
	dateval=epocdate.split("$");

	for(var i=0;i<dateval.length;i++){
	
		if(i==0){
			monthstr = dateval[i];
		}else if(i==1){
			datestr = dateval[i];		
		}else if(i==2){	
			yearstr = dateval[i];		
		}
	}


	if(monthstr==1){
		monthstr="01";		
	}else if(monthstr==2){	
		monthstr="02";
	}else if(monthstr==3){
		monthstr="03";	
	}else if(monthstr==4){
		monthstr="04";	
	}else if(monthstr==5){
		monthstr="05";	
	}else if(monthstr==6){
		monthstr="06";	
	}else if(monthstr==7){
		monthstr="07";	
	}else if(monthstr==8){
		monthstr="08";	
	}else if(monthstr==9){
		monthstr="09";	
	}

	if(datestr==1){
		datestr="01";		
	}else if(datestr==2){	
		datestr="02";
	}else if(datestr==3){
		datestr="03";	
	}else if(datestr==4){
		datestr="04";	
	}else if(datestr==5){
		datestr="05";	
	}else if(datestr==6){
		datestr="06";	
	}else if(datestr==7){
		datestr="07";	
	}else if(datestr==8){
		datestr="08";	
	}else if(datestr==9){
		datestr="09";	
	}

	id = get_id('day');
	id.value=datestr;

	id = get_id('month');
	id.value=monthstr;

	id = get_id('year');
	id.value=yearstr;


	$id = get_id('tab4');
	$id.style.visibility = 'visible';
	$id.style.display = 'block';
	$id = get_id('tab3');
	$id.style.visibility = 'hidden';
	$id.style.display = 'none';


	id1 = get_id("tab1but");
	id1.className = 'tab_not_sel';
	id2 = get_id("tab2but");
	id2.className = 'tab_sel_del_left_not_selected';
	id3 = get_id("tab3but");
	id3.className = 'tab_not_sel';
	id4 = get_id("tab4but");
	id4.className = 'tab_sel_del_left_not_selected';
	id5 = get_id("tab5but");
	id5.className = 'tab_not_sel';
	id6 = get_id("tab6but");
	id6.className = 'tab_sel_del_right_selected';
	id7 = get_id("tab7but");
	id7.className = 'tab_sel';
	id8 = get_id("tab8but");
	id8.className = 'tab_sel_del_left_selected';
	id9 = get_id("tab9but");
	id9.className = 'tab_not_sel';
	id10 = get_id("tab10but");
	id10.className = 'tab_sel_del_left_not_selected';
	id11 = get_id("tab11but");
	id11.className = 'tab_not_sel';
	id12 = get_id("tab12but");
	id12.className = 'tab_sel_right_not_selected';
*/

}

function showDivA(id,tot){

for(i=1;i<tot+2;i++){

$id = get_id("tab" + i);
$id.style.visibility = 'hidden';
$id.style.display = 'none';
id2 = get_id("tab" + i +"nav");
id2.style.borderBottom = "1px solid #000";			
}
if(($id = get_id(id))){
			$id.style.visibility = 'visible';
			$id.style.display = 'block';
			id2 = get_id(id + "nav");
			id2.style.borderBottom = "1px solid #FFF";			
			id2.color = "#FFFFFF";			


			
}
window.location.hash="#tabbox";
}


function showDiv(id,tot){

for(i=1;i<tot+2;i++){
$id = get_id("tab" + i);
$id.style.visibility = 'hidden';
$id.style.display = 'none';

}

if(($id = get_id(id))){
			$id.style.visibility = 'visible';
			$id.style.display = 'block';
}


if(id=="tab1"){

	id1 = get_id("tab1but");
	id1.className = 'tab_sel';
	id2 = get_id("tab2but");
	id2.className = 'tab_sel_del_left_not_selected';
	id3 = get_id("tab3but");
	id3.className = 'tab_not_sel';
	id4 = get_id("tab4but");
	id4.className = 'tab_sel_del_left_selected_enq';
//	id5 = get_id("tab5but");
//	id5.className = 'tab_not_sel';
	id6 = get_id("tab6but");
	id6.className = 'tab_sel_del_right_selected_enq';
	id7 = get_id("tab7but");
	id7.className = 'tab_sel_enq';
	id8 = get_id("tab8but");
	id8.className = 'tab_sel_del_left_not_selected';
	id9 = get_id("tab9but");
	id9.className = 'tab_not_sel';
//	id10 = get_id("tab10but");
//	id10.className = 'tab_sel_del_left_not_selected';
	id11 = get_id("tab11but");
	id11.className = 'tab_not_sel';
	id12 = get_id("tab12but");
	id12.className = 'tab_sel_right_not_selected';
	id13 = get_id("tab13but");
	id13.className = 'tab_sel_del_left_selected';
	id14 = get_id("tab14but");
	id14.className = 'tab_not_sel';
}else if(id=="tab2"){

	id1 = get_id("tab1but");
	id1.className = 'tab_not_sel';
	id2 = get_id("tab2but");
	id2.className = 'tab_sel_del_left_selected';
	id3 = get_id("tab3but");
	id3.className = 'tab_sel';
	id4 = get_id("tab4but");
	id4.className = 'tab_sel_del_left_selected_enq';
//	id5 = get_id("tab5but");
//	id5.className = 'tab_not_sel';
	id6 = get_id("tab6but");
	id6.className = 'tab_sel_del_right_selected_enq';
	id7 = get_id("tab7but");
	id7.className = 'tab_sel_enq';
	id8 = get_id("tab8but");
	id8.className = 'tab_sel_del_left_not_selected';
	id9 = get_id("tab9but");
	id9.className = 'tab_not_sel';
//	id10 = get_id("tab10but");
//	id10.className = 'tab_sel_del_left_not_selected';
	id11 = get_id("tab11but");
	id11.className = 'tab_not_sel';
	id12 = get_id("tab12but");
	id12.className = 'tab_sel_right_not_selected';
	id13 = get_id("tab13but");
	id13.className = 'tab_sel_del_left_not_selected';
	id14 = get_id("tab14but");
	id14.className = 'tab_not_sel';



}else if(id=="tab3"){

	id1 = get_id("tab1but");
	id1.className = 'tab_not_sel';
	id2 = get_id("tab2but");
	id2.className = 'tab_sel_del_left_not_selected';
	id3 = get_id("tab3but");
	id3.className = 'tab_not_sel';
	id4 = get_id("tab4but");
	id4.className = 'tab_sel_del_left_selected_enq';
//	id5 = get_id("tab5but");
//	id5.className = 'tab_sel';
	id6 = get_id("tab6but");
	id6.className = 'tab_sel_del_right_selected_enq';
	id7 = get_id("tab7but");
	id7.className = 'tab_sel_enq';
	id8 = get_id("tab8but");
	id8.className = 'tab_sel_del_right_selected';
	id9 = get_id("tab9but");
	id9.className = 'tab_not_sel';
//	id10 = get_id("tab10but");
//	id10.className = 'tab_sel_del_left_selected';
	id11 = get_id("tab11but");
	id11.className = 'tab_not_sel';
	id12 = get_id("tab12but");
	id12.className = 'tab_sel_right_not_selected';
	id13 = get_id("tab13but");
	id13.className = 'tab_sel_del_left_not_selected';
	id14 = get_id("tab14but");
	id14.className = 'tab_not_sel';

}else if(id=="tab4"){

	id1 = get_id("tab1but");
	id1.className = 'tab_not_sel';
	id2 = get_id("tab2but");
	id2.className = 'tab_sel_del_left_not_selected';
	id3 = get_id("tab3but");
	id3.className = 'tab_not_sel';
	id4 = get_id("tab4but");
	id4.className = 'tab_sel_del_left_selected_enq';
//	id5 = get_id("tab5but");
//	id5.className = 'tab_not_sel';
	id6 = get_id("tab6but");
	id6.className = 'tab_sel_del_right_selected_enq';
	id7 = get_id("tab7but");
	id7.className = 'tab_sel_enq';
	id8 = get_id("tab8but");
	id8.className = 'tab_sel_del_left_not_selected';
	id9 = get_id("tab9but");
	id9.className = 'tab_not_sel';
//	id10 = get_id("tab10but");
//	id10.className = 'tab_sel_del_left_not_selected';
	id11 = get_id("tab11but");
	id11.className = 'tab_not_sel';
	id12 = get_id("tab12but");
	id12.className = 'tab_sel_right_not_selected';
	id13 = get_id("tab13but");
	id13.className = 'tab_sel_del_left_not_selected';
	id14 = get_id("tab14but");
	id14.className = 'tab_not_sel';


}else if(id=="tab5"){

	id1 = get_id("tab1but");
	id1.className = 'tab_not_sel';
	id2 = get_id("tab2but");
	id2.className = 'tab_sel_del_right_selected';
	id3 = get_id("tab3but");
	id3.className = 'tab_not_sel';
	id4 = get_id("tab4but");
	id4.className = 'tab_sel_del_left_selected_enq';
//	id5 = get_id("tab5but");
//	id5.className = 'tab_not_sel';
	id6 = get_id("tab6but");
	id6.className = 'tab_sel_del_right_selected_enq';
	id7 = get_id("tab7but");
	id7.className = 'tab_sel_enq';
	id8 = get_id("tab8but");
	id8.className = 'tab_sel_del_left_not_selected';
	id9 = get_id("tab9but");
	id9.className = 'tab_sel';
//	id10 = get_id("tab10but");
//	id10.className = 'tab_sel_del_left_not_selected';
	id11 = get_id("tab11but");
	id11.className = 'tab_not_sel';
	id12 = get_id("tab12but");
	id12.className = 'tab_sel_right_selected';
	id13 = get_id("tab13but");
	id13.className = 'tab_sel_del_left_not_selected';
	id14 = get_id("tab14but");
	id14.className = 'tab_not_sel';
}else if(id=="tab6"){

	id1 = get_id("tab1but");
	id1.className = 'tab_not_sel';
	id2 = get_id("tab2but");
	id2.className = 'tab_sel_del_left_not_selected';
	id3 = get_id("tab3but");
	id3.className = 'tab_not_sel';
	id4 = get_id("tab4but");
	id4.className = 'tab_sel_del_left_selected_enq';
//	id5 = get_id("tab5but");
//	id5.className = 'tab_not_sel';
	id6 = get_id("tab6but");
	id6.className = 'tab_sel_del_right_selected_enq';
	id7 = get_id("tab7but");
	id7.className = 'tab_sel_enq';
	id8 = get_id("tab8but");
	id8.className = 'tab_sel_del_left_not_selected';
	id9 = get_id("tab9but");
	id9.className = 'tab_not_sel';
//	id10 = get_id("tab10but");
//	id10.className = 'tab_sel_del_right_selected';
	id11 = get_id("tab11but");
	id11.className = 'tab_sel';
	id12 = get_id("tab12but");
	id12.className = 'tab_sel_right_not_selected';
	id13 = get_id("tab13but");
	id13.className = 'tab_sel_del_left_not_selected';
	id14 = get_id("tab14but");
	id14.className = 'tab_not_sel';
}else if(id=="tab7"){

	id1 = get_id("tab1but");
	id1.className = 'tab_not_sel';
	id2 = get_id("tab2but");
	id2.className = 'tab_sel_del_left_not_selected';
	id3 = get_id("tab3but");
	id3.className = 'tab_not_sel';
	id4 = get_id("tab4but");
	id4.className = 'tab_sel_del_left_selected_enq';
//	id5 = get_id("tab5but");
//	id5.className = 'tab_not_sel';
	id6 = get_id("tab6but");
	id6.className = 'tab_sel_del_right_selected_enq';
	id7 = get_id("tab7but");
	id7.className = 'tab_sel_enq';
	id8 = get_id("tab8but");
	id8.className = 'tab_sel_del_left_selected';
	id9 = get_id("tab9but");
	id9.className = 'tab_not_sel';
//	id10 = get_id("tab10but");
//	id10.className = 'tab_sel_del_left_not_selected';
	id11 = get_id("tab11but");
	id11.className = 'tab_not_sel';
	id12 = get_id("tab12but");
	id12.className = 'tab_sel_right_not_selected';
	id13 = get_id("tab13but");
	id13.className = 'tab_sel_del_right_selected';
	id14 = get_id("tab14but");
	id14.className = 'tab_sel';

}
}

function yshowDiv(id,tot){
for(i=1;i<tot+1;i++){
$id = get_id("tab" + i);
$id.style.visibility = 'hidden';
$id.style.display = 'none';
//id2 = get_id("tab" + i +"nav");
//id2.style.borderBottom = "1px solid #000";			
}
if(($id = get_id(id))){
			$id.style.visibility = 'visible';
			$id.style.display = 'block';
			id2 = get_id(id + "nav");
			id2.style.borderBottom = "1px solid #FFF";			
			id2.color = "#FFFFFF";			


			
}
}

function xshowDiv(id){
$id = get_id("tab1");
$id.style.visibility = 'hidden';
$id.style.display = 'none';
id2 = get_id("tab1nav");
id2.style.borderBottom = "1px solid #000";			
$id = get_id("tab2");
$id.style.visibility = 'hidden';
$id.style.display = 'none';
id2 = get_id("tab2nav");
id2.style.borderBottom = "1px solid #000";			
$id = get_id("tab3");
$id.style.visibility = 'hidden';
$id.style.display = 'none';
id2 = get_id("tab3nav");
id2.style.borderBottom = "1px solid #000";			
$id = get_id("tab4");
$id.style.visibility = 'hidden';
$id.style.display = 'none';
id2 = get_id("tab4nav");
id2.style.borderBottom = "1px solid #000";			
$id = get_id("tab5");
$id.style.visibility = 'hidden';
$id.style.display = 'none';
id2 = get_id("tab5nav");
id2.style.borderBottom = "1px solid #000";			
$id = get_id("tab6");
$id.style.visibility = 'hidden';
$id.style.display = 'none';
id2 = get_id("tab6nav");
$id = get_id("tab7");
$id.style.visibility = 'hidden';
$id.style.display = 'none';
id2 = get_id("tab7nav");
id2.style.borderBottom = "1px solid #000";			
if(($id = get_id(id))){
			$id.style.visibility = 'visible';
			$id.style.display = 'block';
			id2 = get_id(id + "nav");
			id2.style.borderBottom = "1px solid #FFF";			
			id2.color = "#FFFFFF";			


			
}
}

function get_mouse(e){

}

function getDialog(p,field){
var x=event.x+document.body.scrollLeft + 20;
var y=event.y+document.body.scrollTop + 40;
	window.open(p + "includes/datedialog.php?f=" + field ,"test","left=" + x + ", top=" + y + " , toolbars=no,location=no,status=no,scrollbars=no,width=150, height=137");
}

function SetUrl(field, url){
document.getElementById(field).value = url;
}

function OpenServerBrowser( type, url, width, height )
{


	sActualBrowser = type ;

	var iLeft = (screen.width  - width) / 2 ;
	var iTop  = (screen.height - height) / 2 ;

	var sOptions = "toolbar=no,status=no,resizable=yes,dependent=yes" ;
	sOptions += ",width=" + width ;
	sOptions += ",height=" + height ;
	sOptions += ",left=" + iLeft ;
	sOptions += ",top=" + iTop ;

	var oWindow = window.open( url, "FCKBrowseWindow", sOptions ) ;
}

function getImageDialog(rel,field){
var x=event.x+document.body.scrollLeft + 20;
var y=event.y+document.body.scrollTop + 40;

var type ="Image";
var url =rel +"FCKeditor/editor/filemanager/browser/default/browser_light.html?Type=Image&Connector=connectors/php/connector.php&field="+ field;
OpenServerBrowser( type, url, 700, 700 )
//	window.open("fckeditor/editor/dialog/fck_image_light.html?f=" + field ,"test","left=" + x + ", top=" + y + " , toolbars=no,location=no,status=no,scrollbars=no,width=450, height=150");
}


function getDirectories(){
var x=event.x+document.body.scrollLeft + 20;
var y=event.y+document.body.scrollTop + 40;

var url =rel +"includes/image/dir_list.php";
OpenWindow( type, url, 700, 700 )
//	window.open("fckeditor/editor/dialog/fck_image_light.html?f=" + field ,"test","left=" + x + ", top=" + y + " , toolbars=no,location=no,status=no,scrollbars=no,width=450, height=150");
}

function getFlashDialog(rel,field){
var x=event.x+document.body.scrollLeft + 20;
var y=event.y+document.body.scrollTop + 40;

var type ="Flash";
var url =rel +"FCKeditor/editor/filemanager/browser/default/browser_light.html?Type=Flash&Connector=connectors/php/connector.php&field="+ field;
OpenServerBrowser( type, url, 700, 700 )
//	window.open("fckeditor/editor/dialog/fck_image_light.html?f=" + field ,"test","left=" + x + ", top=" + y + " , toolbars=no,location=no,status=no,scrollbars=no,width=450, height=150");
}



function getFileDialog(rel,field){
var x=event.x+document.body.scrollLeft + 20;
var y=event.y+document.body.scrollTop + 40;

var type ="File";
var url =rel +"FCKeditor/editor/filemanager/browser/default/browser_light.html?Type=File&Connector=connectors/php/connector.php&field="+ field;
OpenServerBrowser( type, url, 700, 700 )
//	window.open("fckeditor/editor/dialog/fck_image_light.html?f=" + field ,"test","left=" + x + ", top=" + y + " , toolbars=no,location=no,status=no,scrollbars=no,width=450, height=150");
}


function openWindow(win,w,h,field){
window.open(win + '?fieldref=' + field,'test','width=' + w + ', height=' + h + ',scrollbars=yes');
}

function getDirectories(){
var x=event.x+document.body.scrollLeft + 20;
var y=event.y+document.body.scrollTop + 40;

var url ="includes/image/dir_list.php";
window.open(url,'test','left=550, top=400, width=' + 350 + ', height=' + 300 + ',scrollbars=yes');
}

function getDirectoriesRel(ref){
var x=event.x+document.body.scrollLeft + 20;
var y=event.y+document.body.scrollTop + 40;

var url =ref +"includes/image/dir_list.php";
window.open(url,'test','left=550, top=400, width=' + 350 + ', height=' + 300 + ',scrollbars=yes');
}

function getPageDialog(rel,x,y){
var x=event.x+document.body.scrollLeft + 20;
var y=event.y+document.body.scrollTop + 40;

var url =rel + "includes/banner/page_list.php";
window.open(url,'test','left=' + x + ', top=' + y + ', width=' + 250 + ', height=' + 300 + ',scrollbars=yes');
}

function getDealerDialog(rel,x,y){
var x=event.x+document.body.scrollLeft + 20;
var y=event.y+document.body.scrollTop + 40;

var url ="get_dealer_list.php";
window.open(url,'test','left=' + x + ', top=' + y + ', width=' + 250 + ', height=' + 300 + ',scrollbars=yes');
}

function getFraseDialog(rel,from){
var x=event.x+document.body.scrollLeft;
var y=event.y+document.body.scrollTop;

var url ="get_frase_list.php?from=" +from;
window.open(url,'test','left=' + x + ', top=' + y + ', width=' + 350 + ', height=' + 300 + ',scrollbars=yes');
}


