function launch(url, w_width, w_height) {
	window.open(url, 'page'+w_width+w_height,'titlebar=no,top=0,left=0,width=' + w_width +',height=' + w_height +',screenX=0,screenY=0,top=0,left=0,scrollbars=1');
}

function launch2(url, w_width, w_height) {
	window.open(url, 'links'+w_width+w_height,'top=0,left=0,screenX=0,screenY=0,top=0,left=0,scrollbars=1');
}

function launch3(url, w_width, w_height) {
	window.open(url, 'page'+w_width+w_height,'titlebar=no,top=0,left=0,width=' + w_width +',height=' + w_height +',screenX=0,screenY=0,top=0,left=0,scrollbars=0');
}

function launch4(url, w_width, w_height) {
	window.open(url,'links','scrollbars=1,width=' + w_width +',height=' + w_height +'');
}

function PreviewMap(url,pagename,width,height,scrollbars){
	var winLeft = (screen.width-width)/2;
	var winTop = (screen.height-(height+110))/2;
	window.open(url,pagename,'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=' + scrollbars + ',resizable=0,left=' + winLeft + ',top=' + winTop + ',width=' + width + ',height=' + height + '');
}

function forgotPassword() {
	 launch("forgotpassword.php",790,500);
	//alert("Please contact our member contact centre.\nTel: +662 352 3000\nEmail: memberservice@thailandelite.com");
}

function signupNow() {
	 launch("member_signup.php",790,500);
}

function CheckResolution(){
	var aWidth,aHeight;
	if (self.innerHeight) { // all except Explorer
		aWidth = self.innerWidth;
		aHeight = self.innerHeight;
	} else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
		aWidth = document.documentElement.clientWidth;
		aHeight = document.documentElement.clientHeight;
	} else if (document.body) {  // other Explorers
		aWidth = document.body.clientWidth;
		aHeight = document.body.clientHeight;
	}
	var col_width = (aWidth - (790 + 12 + 88)) / 2;
	var row_height = (aHeight - (413 + 103 + 31 + 26))/3;
	ExpandRow(row_height);
	ExpandColumn(col_width);
}

function ExpandRow(row_height){
	//var innerhtml = '<table border="0" cellspacing="0" cellpadding="0"><tr><td height="' + row_height + '" ></td></tr></table>';
	var innerhtml = '<img src="./images/themes/dot.gif" width="1" height="' + row_height +'" />';
	var innerhtml2 = '<img src="./images/themes/dot.gif" width="1" height="' + (row_height*2) +'" />';
	document.getElementById('dynamic_row_top').innerHTML = innerhtml;
	document.getElementById('dynamic_row_bottom').innerHTML = innerhtml2;
}

function ExpandColumn(col_width){
	//var innerhtml = '<table border="0" cellspacing="0" cellpadding="0"><tr><td width="' + col_width + '" ></td></tr></table>';
	var innerhtml = '<img src="./images/themes/dot.gif" width="' + col_width +'" height="1" />';
	document.getElementById('dynamic_col_left').innerHTML = innerhtml;
	document.getElementById('dynamic_col_right').innerHTML = innerhtml;	
}

function changeInnerHTML(divId,html){
 var e=null;
 if (document.getElementById) {
     e=document.getElementById(divId);
          if(!e)return false;
          if("innerHTML" in e){
               e.innerHTML=html;return true
          }
          else if("firstChild" in e && "data" in e.firstChild){
               e.firstChild.data=html;return true;
          }
          else{
               return false;
          }
 }else if(document.layers){
     e=document.layers[divId];
          if(typeof e=="undefined"||!e){
               e=document[divId];
               if(typeof e=="undefined"||!e)return false;
          }
     e.document.open();
     e.document.write(html);
     e.document.close();
     return true;
 }else if(document.all){
     e=document.all[divId];
     if(typeof e=="undefined"||!e)return false;
     e.innerHTML=html;
     return true;
 }
 alert('false');
 return false;
}

window.onload = CheckResolution;
window.onresize = CheckResolution;