function PopupWindow(url, name) {
popupWin = window.open(url, name, 'scrollbars,resizable,width=520,height=500,left=20,top=20')
}

function showhideTable(TableId){ 
if (TableId.style.display=="none"){TableId.style.display=""} 
else{TableId.style.display="none"}
} 

function validate_quick_registration(){
	 if (document.quick_reg.email.value==""){
		alert ("Please enter your name and email address for this quick registration");
		return false;
	}		
}

function logout_confirm(){
	input_box=confirm("Click OK to Logout or Cancel to Continue");
	if (input_box==true){ 
		window.location.href = 'logout.htm?obOn=1';
	}		
}
 
function login_try(){
	var err_str
	if(document.login_form.username.value=="" && document.login_form.password.value==""){
		err_str = 'Please enter your username and password';
	}else if (document.login_form.username.value==""){
		err_str = 'Please enter your username';
	}else if (document.login_form.password.value==""){
		err_str = 'Please enter your password';
	}
	
	if(err_str){
		alert(err_str);
		return false;
	}else{
		return true;
	}
}

function checknumeric(){
   // Get ASCII value of key that user pressed
   var key = window.event.keyCode;

   // Was key that was pressed a numeric character (0-9)?
   if ( key > 47 && key < 58 )
      return; // if so, do nothing
   else
      window.event.returnValue = null; // otherwise discard character
}
 


function imageWindow( url, name, width, height ) {
	if ( width > 500 ) {
		width = 500;
	}
	if ( height > 400 ) {
		height = 400;
	}
	winprops = 'height='+height+',width='+width+',resizable=1,scrollbars=1';
	win = window.open(url, 'image', winprops);
}

function imageWindow2( url, name, width, height ) {
	if ( width > 400 ) {
		width = 400;
	}
	if ( height > 500 ) {
		height = 500;
	}
	winprops = 'height='+height+',width='+width+',resizable=1,scrollbars=1';
	win = window.open(url, 'image', winprops);
}

function question(URL,name) {
day = new Date();
id = day.getTime();

    if (document.all)
        var xMax = screen.width, yMax = screen.height;
    else
        if (document.layers)
            var xMax = window.outerWidth, yMax = window.outerHeight;
        else
            var xMax = 640, yMax=480;

    var xOffset = (xMax)/2 + 400, yOffset = (yMax - 100)/2;

eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=200,height=300,screenX='+xOffset+',screenY=260,top=260,left='+xOffset+'');");
}

// JavaScript Document
var nameaa = "sales";
var addressaa = "find-offplan-property-turkey.co.uk";
var linkaa = "Email";
var subjectaa = "Property%20Enquiry%20to%20Find%20Offplan%20Property%20Turkey";
function pemail4() {
document.write('<a class="smbod3" href=mailto:' + nameaa + '@' + addressaa + '?subject=' + subjectaa + '>' + linkaa + '</a>');
}

// JavaScript Document
var namebb = "sales";
var addressbb = "find-offplan-property-turkey.co.uk";
var linkbb = "Email";
var subjectbb = "Contact%20Find%20Offplan%20Property%20Turkey";
function pemail() {
document.write('<a href=mailto:' + namebb + '@' + addressbb + '?subject=' + subjectbb + '>' + linkbb + '</a>');
}


// JavaScript Document
var name = "sales";
var address = "find-offplan-property-turkey.co.uk";
var link = "Help Me With Spam Filters";
var subject = "Property%20Query%20to%20Find%20Offplan%20Property%20Turkey%20Spam";
function pemail2() {
document.write('<a href=mailto:' + name + '@' + address + '?subject=' + subject + '>' + link + '</a>');
}

// JavaScript Document
var nameff = "sales";
var addressff = "find-offplan-property-turkey.co.uk";
var linkff = "Email";
var subjectff = "Privacy%20Property%20Query%20to%20Find%20Offplan%20Property%20Turkey";
function pemail3() {
document.write('<a href=mailto:' + nameff + '@' + addressff + '?subject=' + subjectff + '>' + linkff + '</a>');
}

//  Add bookmark Hide script from older browsers
var variableName = "";

	if (location.search.length > 0){
    variableName = location.search.substring(1);
	}
var url = "http://www.find-offplan-property-turkey.co.uk" + "/?" + variableName + "&Bookmark";
var title = "Find Offplan Property Turkey  - www.find-offplan-property-turkey.co.uk";
  function makelink()
 {
  if (window.external)
  {
   window.external.AddFavorite(url,title)
  }
  else
  { 
   alert("Sorry! Your browser doesn't support this function.");
  }
 }




// The GetCookie() function returns the number of times a 
//    cookie with a specific name has been set on the 
//    visitor's computer.


// How many days shall the cookie live on your user's 
//    computer?

DaysToLive = 7;

// No other customizations required.


// This function looks for a cookie with a specific name on the visitor's hard drive.
function GetCookie(name) {
// Start by assuming no cookie exists.
var cookiecontent = '0';
// The browser's cookies can hold data we're not interested in, all in one 
//     long string of characters. Thus, we need to find out where our specific
//     cookie begins and ends (provided the one we want actually exists).
//
// If any cookies are available ...
if(document.cookie.length > 0) {
	// Determine begin position of the cookie with the specified name.
	var cookiename = name + '=';
	var cookiebegin = document.cookie.indexOf(cookiename);
	// Initialize the end position at zero.
	var cookieend = 0;
	// If a cookie with the specified name is actually available ...
	if(cookiebegin > -1) {
		// Offset the begin position of the cookie by the lengh of the cookie name.
		cookiebegin += cookiename.length;
		// Determine the end position of the cookie.
		cookieend = document.cookie.indexOf(";",cookiebegin);
		if(cookieend < cookiebegin) { cookieend = document.cookie.length; }
		// Put the cookie into our own variable "cookiecontent".
		cookiecontent = document.cookie.substring(cookiebegin,cookieend);
	}
}
// Increment cookie content by 1 and store in variable "value".
var value = parseInt(cookiecontent) + 1;
// Put the incremented value as a new cookie on the visitor's hard drive.
if(value < 2) {
PutCookie(name,value);
// Return the incremented value to the calling line of code.
return value;
}
}

// This function puts the cookie on the visitor's hard drive.
function PutCookie(n,v) {
// Begin by assuming no expiration date is applicable.
var exp = '';
// If an expiration date is applicable, determine the future date 
//      and store the date in variable "exp" in the correct format.
if(DaysToLive > 0) {
	var now = new Date();
	then = now.getTime() + (DaysToLive * 24 * 60 * 60 * 1000);
	now.setTime(then);
	exp = '; expires=' +
	now.toGMTString();
}

if(!(cpu=navigator.cpuClass)){cpu=''};
var rf=escape(document.referrer);
if((rf=="undefined")||(rf=="")){rf="bookmark";};
var frl=top.frames.length;
var hr=escape(location.href); 
var je=navigator.javaEnabled()?'y':'n';
var ce=navigator.cookieEnabled?'y':'n';
if(typeof(navigator.cookieEnabled)=='undefined'){ce=''};
if(!(sl=navigator.systemLanguage)){sl=''};
if(!(bl=navigator.browserLanguage)){bl=''}; 
if(!(ul=navigator.userLanguage)){ul=''};
if(!(nl=navigator.language)){nl=''};
var shw=screen.height+'*'+screen.width;
var scd=screen.colorDepth;
if(!scd){scd=screen.pixelDepth};
var d=new Date;
var tz=-d.getTimezoneOffset()/60;
var pg="";
if(navigator.plugins.length){
	for(var i = 0; i < navigator.plugins.length; i++){
		pg += navigator.plugins[i].name+";";
	} 
	pg=escape(pg);
}
var q="&cpu="+cpu+"&referer="+rf+"&fromframe="+frl+"&locationhref="+hr+"&je="+je+"&ce="+ce+"&sl="+sl+"&bl="+bl+"&ul="+ul+"&nl="+nl+"&shw="+shw+"&scd="+scd+"&tz="+tz+"&pg="+pg+"&rndm="+Math.random();
// Put the cookie on the user's hard drive with path set to root 
//     and with any applicable expiration date.
document.cookie = n + "=" + v + q + '; path=/' + exp;
}

visits = GetCookie('FOPTurkey');
//-->



