
function fnAddToFavs( pageurl, pagetitle){
	window.external.AddFavorite( pageurl, pagetitle)
}

function setHomePage( obj, url){
	obj.style.behavior='url(#default#homepage)';
	obj.setHomePage( url);
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function MM_displayStatusMsg(msgStr) { //v1.0
  status=msgStr;
  document.MM_returnValue = true;
}


var popUpWin=0;
function popUpWindow(URLStr, left, top, width, height)
{
  if(popUpWin)
  {
    if(!popUpWin.closed) popUpWin.close();
  }
  popUpWin = open(URLStr, 'popUpWin', 'toolbar=no,location=no,directories=no,status=no,menub ar=no,scrollbars=yes,resizable=no,copyhistory=yes,width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+'');
}

var flag=false; 
function DrawImage(ImgD, width_x, height_x){ 
var image=new Image(); 
image.src=ImgD.src; 
if(image.width>0 && image.height>0){ 
flag=true; 
if(image.width/image.height>= width_x/height_x){ 
if(image.width>width_x){ 
ImgD.width=width_x; 
ImgD.height=(image.height*width_x)/image.width; 
}else{ 
ImgD.width=image.width; 
ImgD.height=image.height; 
} 
ImgD.alt=image.width+"x"+image.height; 
} 
else{ 
if(image.height>height_x){ 
ImgD.height=height_x; 
ImgD.width=(image.width*height_x)/image.height; 
}else{ 
ImgD.width=image.width; 
ImgD.height=image.height; 
} 
ImgD.alt=image.width+"x"+image.height; 
} 
} 
} 



function loadPage(cid, pageid, skins, lans){
	document.location.href = "?id=" + cid + "&page=" + pageid + "&skin=" + skins + "&lan=" + lans;
}


function showlayer( div_name, tarstr, li) { //v2.0
	var showdiv=true;
	var div_obj = eval( div_name + tarstr );
	
	if( div_obj[li-1].style.display=='none') { showdiv=false;}
	
	for (i = 0; i <= div_obj.length-1; i++){
		div_obj[i].style.display='none';
	}
	if (!showdiv) { div_obj[li-1].style.display='inline';}

  return true;
}
