/* Dynamic Code Taken from Header */
		function ViewPopup(p_id,type,showorder,idtype) 
		{ 
			if(!idtype) idtype='p_id';
			
			if(!showorder) showorder=1;
		window.open('/easyconsole.cfm?page=mediapopup&idtype='+idtype+'&'+idtype+'='+p_id+'&type='+type+'&showorder='+showorder, 'ECRpopup', 		
'toolbar=no,status=yes,scrollbars=yes,location=no,resizable=yes,menubar=no,directories=no,width=681,height=590');
							
		}
		function printProperty(id)
		{							
			window.open('/easyconsole.cfm?page=print_property&p_id='+id+"&print=1",'PrintableWindow','status=yes,location=no,reload=yes,resizable=no,scrollbars=yes,width=640,height=550');
		}		
		
		function printDevelopment(id)
		{								
			window.open('/easyconsole.cfm?page=print_this_development&d_id='+id+"&print=1",'PrintableWindow','status=yes,location=no,reload=yes,resizable=no,scrollbars=yes,width=640,height=550');
		}	

		function printThisProperty(id)
		{							
			window.open('/easyconsole.cfm?page=print_property&p_id='+id+"&print=1",'PrintableWindow','status=yes,location=no,reload=yes,resizable=no,scrollbars=yes,width=600,height=550');
		}
		
		function printThisDevelopment(id)
		{							
			window.open('/easyconsole.cfm?page=print_development&d_id='+id+"&print=1",'PrintableWindow','status=yes,location=no,reload=yes,resizable=no,scrollbars=yes,width=600,height=550');
		}	
		
/* End of Dynamic Code Taken from Header */



function toggleClass(id,flg)
{
	if (flg==1) document.getElementById(id).className="buttons111"; else  document.getElementById(id).className="buttons1";; 	
}

var isNav,isIE;


if (parseInt(navigator.appVersion) >=4 ) {
	if (navigator.appName == "Netscape") {
		isNav = true
	} else {
		isIE = true
		col1 = "all."
		styleObj = ".Style"
	}
}

window.status='www.alphapanareti.com - Alpha Panareti Land and Property Developers - powered by EasyConsole CMS';
function hidestatus(){
window.status='www.alphapanareti.com - Alpha Panareti Land and Property Developers - powered by EasyConsole CMS';
return true
}

if (document.layers)
document.captureEvents(Event.MOUSEOVER | Event.MOUSEOUT)

document.onmouseover=hidestatus
document.onmouseout=hidestatus

function openMp3(id)
{
	popupWidth=300;
	popupHeight=20;		
	mywindow=window.open("/mp3player.cfm?mp3id="+id,"mp3Player","status=yes,location=no,reload=yes,resizable=yes,scrollbars=yes,width="+popupWidth+",height="+popupHeight+"\"");
	mywindow.focus();
}

function showvideo(video) {
	var str = new String("/images/media/video/" + video)
	window.open(str, "movieWin", "width=320, height=240")
}

function currency(curr,amount,lang,th) {
	wn=window.open('/utils/currency.cfm?currency='+curr+'&amount='+amount+'&lang='+lang+'&th='+th,'currency','width=465,height=315');
}

function metric(unit,amount,lang) { 
	wn=window.open('/utils/metric.cfm?unit='+unit+'&amount='+amount+'&lang='+lang,'metric','width=280,height=220');
}

function mortgage(unit,amount,lang) { 
	wn=window.open('/utils/mortgage.cfm?unit='+unit+'&amount='+amount+'&lang='+lang,'morgage','width=400,height=320');
}

function borrowtool(th) { 
	wn=window.open('/utils/borrow_calculator.cfm?th='+th,'borrow','width=300,height=303');
}

function sendEmail(id,idtype) {
	if(!idtype) idtype='p_id';
	wn=window.open('/easyconsole.cfm?page=sendmail&print=1&idtype='+idtype+'&p_id='+id,'SendMail','width=500,height=360');
}

function openFolder(id,idtype)
{
  if(!idtype) idtype='p_id';
  popupwindow=window.open('/easyconsole.cfm?page=myfolder&idtype='+idtype+'&p_id='+id,'myfolder','width=640,height=400,scrollbars=yes,resizable=no');
  popupwindow.focus();
  return true;
}

function gallerypopup(id,type,width,height) {
	if (!type) type='image';
	if (!width) width=640;
	if (!height) height=550;
	
	if (type=='image') pagename='photoviewer';
	if (type=='video') pagename='videoviewer';
	
	wn=window.open('/easyconsole.cfm?page='+pagename+'&id='+id,'gpopup','width='+width+',height='+height+',resizable=yes,scrollbars=yes');	
}

function mortgagePrinter(p_id,amount,rate,years,mydeposit,mydeposit2,mydeposit3,mydeposit4) {
 wn=window.open('/easyconsole.cfm?page=mortgagePrinter&p_id='+p_id+'&print=1&amount='+amount+'&rate='+rate+'&years='+years+'&mydeposit='+mydeposit+'&mydeposit2='+mydeposit2+'&mydeposit3='+mydeposit3+'&mydeposit4='+mydeposit4,'mortgage','width=550,height=550,resizable=yes,scrollbars=yes');
}


function toggledisplay(id){
	show_tr=eval("TR"+id);
	
	if (show_tr.style.display == 'none') {
		show_tr.style.display='block';
		}
	else {
		show_tr.style.display='none';
	}
}

/* Begin of How much can i borrow script */

function calc()
{
        var result1;
        var result2;
        var mysal;
        var partsal;
        var lcMysal;
        var lcParsal;
        var lcTempString;
        var number = "0123456789.";
        var liCounter;
        lcMysal = document.frmTest.mysal.value;
        liCounter = 0;
        lcTempString = "";
        while (liCounter < lcMysal.length)
        {
                if( number.indexOf( lcMysal.charAt(liCounter) , 0) != -1)
                {
                        lcTempString += lcMysal.charAt(liCounter);
                }
                liCounter++;
        }
        lcMysal = lcTempString;
        mysal = parseFloat(lcMysal);
        if(isNaN(mysal))
        {
                mysal = 0;
        }
        document.frmTest.mysal.value = currencyAmount(mysal);
        lcParsal = document.frmTest.partsal.value;
        liCounter = 0;
        lcTempString = "";
        while (liCounter < lcParsal.length)
        {
                if( number.indexOf( lcParsal.charAt(liCounter), 0) != -1)
                {
                        lcTempString += lcParsal.charAt(liCounter);
                }
                liCounter++;
        }
        lcParsal = lcTempString;
        partsal = parseFloat(lcParsal);
        if(isNaN(partsal))
        {
                partsal = 0;
        }
        document.frmTest.partsal.value = currencyAmount(partsal);
        result1 = (mysal + partsal) * 2.5;
        result2 = ((mysal * 4 ) + (partsal));
        if(partsal > mysal)
        {
                result2 = ((partsal * 4 ) + (mysal));
        }
        if(isNaN(result1))
        {
                result1 = 0;
        }
        if(isNaN(result2))
        {
                result2 = 0;
        }
        if(result1 > result2)
        {
                result.innerHTML = currencyAmount(result1);
        }
        else
        {
                result.innerHTML = currencyAmount(result2);
        }
}
function currencyAmount(obj)
{
       if(isNaN(obj))
       {
            obj = 0;
       } 
        Num = "" + obj;
        dec = Num.indexOf(".");
        end = ((dec > -1) ? "" + Num.substring(dec,Num.length) : ".00");
        Num = "" + parseInt(Num);
        var temp1 = "";
        var temp2 = "";
        if(end.length == 2)
        {
                end += "0";
        }
        if(end.length == 1)
        {
                end += "00";
        }
        if(end == "")
        {
                end += ".00";
        }
        if(end.length >= 3)
        {
                end = "." + end.substring(1,3);
        }
        var count = 0;
        for(var k = Num.length - 1;k >= 0; k--)
        {
                var oneChar = Num.charAt(k);
                if(count == 3)
                {
                        temp1 += ",";
                        temp1 += oneChar;
                        count = 1;
                        continue;
                }
                else
                {
                        temp1 += oneChar;
                        count++;
                }
        }
        for(var k = temp1.length -1;k >= 0;k--)
        {
                var oneChar = temp1.charAt(k);
                temp2 += oneChar;
        }
        temp2 = String.fromCharCode(163) + temp2 + end;
        return temp2;
}
function makeNumber(obj)
{
        var lcTempString = "";
        var lcNumber = "0123456789.";
        var liCounter = 0;
        while(liCounter <= obj.length)
        {
                if(lcNumber.indexOf(obj.charAt(liCounter),0) != -1)
                {
                        lcTempString += obj.charAt(liCounter);
                }
                liCounter++;
        }
        if(lcTempString == "")
        {
                lcTempString = 0;
        }
        return lcTempString;
}

/* Begin of How much can i borrow script */

function mv (id) {
	id.className=id.className+'Over';
	
}

function mo (id) {
	var myclass = id.className;
	id.className=myclass.replace("Over","");
}

function topMenuRollOver(id,rostatus,selected) {				
	middle=document.getElementById("topMenubt"+id+"repeat");
	left=document.getElementById("topMenubt"+id+"left");
	right=document.getElementById("topMenubt"+id+"right");	
	
	if (rostatus==1) 
	{		
		left.className="topMenubtleftSelected";
		middle.className="topMenubtrepeatSelected";
		right.className="topMenubtrightSelected";
	}
	else
	{		
		if (selected==1)
		{
			left.className="topMenubtleftSelected";
			middle.className="topMenubtrepeatSelected";
			right.className="topMenubtrightSelected";
		}
		else
		{
			left.className="topMenubtleft";
			middle.className="topMenubtrepeat";
			right.className="topMenubtright";
		}
	}	
}

function popUp(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=550,height=470,left = 540,top = 225');");
}

function SubmitAffiliate() {
		  wn=window.open('/easyconsole.cfm?page=submitaffiliate','Submit','width=600,height=700');
}

function submitSearchForm(action) {
	a=document.forms.searchForm;
	a.action=action
	a.submit();
}

function submitQuickSearch(min_bedrooms,pt_id_list){
	document.forms.quickSearchForm.min_bedrooms.value = min_bedrooms;
	document.forms.quickSearchForm.pt_id_list.value = pt_id_list;
	document.forms.quickSearchForm.submit();
}
function printAvailabilityList() {
window.open('/easyconsole.cfm?page=print_av_list','PrintableWindow','status=yes,location=no,reload=yes,resizable=no,scrollbars=yes,width=640,height=550');  
}



function showHideImage(show,allimages){
	arr = allimages.split(','); 
	
	for(i=0;i<arr.length;i++)
	{
		if (arr[i] != show)
		{
			document.getElementById('photo_'+arr[i]).style.display = 'none'
			document.getElementById('h1_'+arr[i]).style.display = 'none'
		}
		else
		{
			document.getElementById('photo_'+arr[i]).style.display = ''
			document.getElementById('h1_'+arr[i]).style.display = ''
		}
	}
}



