// JavaScript Document
var flag=false; 
function DrawImage(ImgD){ 
var image=new Image(); 
image.src=ImgD.src; 
if(image.width>0 && image.height>0){ 
flag=true; 
if(image.width/image.height>= 130/160){ 
if(image.width>130){ 
ImgD.width=130; 
ImgD.height=(image.height*130)/image.width; 
}else{ 
ImgD.width=image.width; 
ImgD.height=image.height; 
} 
ImgD.alt=image.width+"กม"+image.height; 
} 
else{ 
if(image.height>160){ 
ImgD.height=160; 
ImgD.width=(image.width*160)/image.height; 
}else{ 
ImgD.width=image.width; 
ImgD.height=image.height; 
} 
ImgD.alt=image.width+"กม"+image.height; 
} 
} 
} 

function DrawImage2(ImgD){ 
var image=new Image(); 
image.src=ImgD.src; 
if(image.width>0 && image.height>0){ 
flag=true; 
if(image.width/image.height>= 130/200){ 
if(image.width>130){ 
ImgD.width=130; 
ImgD.height=(image.height*130)/image.width; 
}else{ 
ImgD.width=image.width; 
ImgD.height=image.height; 
} 
ImgD.alt=image.width+"กม"+image.height; 
} 
else{ 
if(image.height>200){ 
ImgD.height=200; 
ImgD.width=(image.width*200)/image.height; 
}else{ 
ImgD.width=image.width; 
ImgD.height=image.height; 
} 
ImgD.alt=image.width+"กม"+image.height; 
} 
} 
} 

function DrawImage3(ImgD){ 
var image=new Image(); 
image.src=ImgD.src; 
if(image.width>0 && image.height>0){ 
flag=true; 
if(image.width/image.height>= 165/180){ 
if(image.width>165){ 
ImgD.width=165; 
ImgD.height=(image.height*165)/image.width; 
}else{ 
ImgD.width=image.width; 
ImgD.height=image.height; 
} 
ImgD.alt=image.width+"กม"+image.height; 
} 
else{ 
if(image.height>180){ 
ImgD.height=180; 
ImgD.width=(image.width*180)/image.height; 
}else{ 
ImgD.width=image.width; 
ImgD.height=image.height; 
} 
ImgD.alt=image.width+"กม"+image.height; 
} 
} 
}


function showsubmenu(sid)
{
var whichEl = document.getElementById("submenu" + sid);
if (whichEl.style.display == "none")
{
whichEl.style.display = '';
}
else
{
whichEl.style.display = 'none';
}
}



function jump2url(){
   jumpUrl=bannerADlink[adNum];
   jumpTarget='_blank';
   if (jumpUrl != ''){
      if (jumpTarget != '')window.open(jumpUrl,jumpTarget);
      else location.href=jumpUrl;
   }
}
function displayStatusMsg() { 
   status=bannerADlink[adNum];
   document.returnValue = true;
}
