function f_lng(show){
if (show) document.getElementById('lng_tip').style.display = 'block';
else document.getElementById('lng_tip').style.display = 'none';
}

function PopupPic(sPicURL) { 
	window.open("popup.htm?"+sPicURL, "", "resizable=1,HEIGHT=200,WIDTH=200");
}

function openWin(URL) {
window.open(URL,"thewindow","toolbar=no,width=390,height=300,status=no,scrollbars=yes,resize=no,menubar=no");
}

function openWin1(URL) {
window.open(URL,"thewindow","toolbar=no,width=600,height=800,status=no,scrollbars=no,resize=no,menubar=no");
}

function openWin2(URL) {
window.open(URL,"thewindow","toolbar=no,width=600,height=300,status=no,scrollbars=no,resize=no,menubar=no");
}


// JavaScript Document
function fixFlash() {
	var obj = document.getElementsByTagName("object");
	for (var i=0; i<obj.length; i++) obj[i].outerHTML = obj[i].outerHTML;
}


function preloadImages() {
	var d=document; if(d.images) { if(!d.p) d.p=new Array();
		var i,j=d.p.length,a=preloadImages.arguments; for(i=0; i<a.length; i++)
		if (a[i].indexOf("#")!=0) { d.p[j]=new Image; d.p[j++].src=a[i];}}
}

function swapImgRestore() {
	var i,x,a=document.sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function findObj(n, d) {
	var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
		d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
	if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
	for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=findObj(n,d.layers[i].document);
	if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function swapImage() {
	var i,j=0,x,a=swapImage.arguments; document.sr=new Array; for(i=0;i<(a.length-2);i+=3)
		if ((x=findObj(a[i]))!=null){document.sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function showdeposit(id){
	var st=document.getElementById(id).style;
	st.display=st.display=='block'?'none':'block';
}

function showmenu(id){
	var st=document.getElementById(id).style;
	st.display=st.display=='block'?'none':'block';
}

function showmenus(){

	closetimer = window.setTimeout(mstay,timeout);
}

function showmenu1(id){
	var st=document.getElementById(id).style;
	st.display=st.display=='block'?'none':'block';
}

function showw(id){
	var st=document.getElementById(id).style;
	st.display=st.display=='block'?'none':'block';
}

function hidemenu(id){
	var st=document.getElementById(id).style;
	st.display=st.display=='none'?'none':'none';
}


function openBrWindow(theURL,winName,features) {
	window.open(theURL,winName,features);
}

function jumpMenu(targ,selObj,restore) {
	eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
	if (restore) selObj.selectedIndex=0;
}

function goToURL() {
	var i, args=goToURL.arguments; document.returnValue = false;
	for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
}

function CloseMe() {
	window.close()
}

function objHide(id) {
	document.getElementById(id).style.display='none';
}

function objShow(id) {
	document.getElementById(id).style.display='inline';
}


function openwin(theURL,winName,features) {
  window.open(theURL,winName,features);
}

function showPic (path) {
 if (document.getElementById) {
  document.getElementById('view').src = path.href;
  return false;
 } else {
  return true;
 }
}

function verify()
{

if (document.forms[0].mail.value.search(/^.+@.+\..+$/))
     {
     alert("Please include a valid email address!")
     return
     }
else
     {
 alert("You have filled out the form correctly!")
     }
}

var isIE=window.ActiveXObject?true:false;
function addFlash(path,w,h,id,alt)
{
	var args=addFlash.arguments,p,pos;
	var code=isIE?'<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab" width="'+w+'" height="'+h+'" id="'+id+'"><param name="movie" value="'+path+'" />':'<object type="application/x-shockwave-flash" data="'+path+'" width="'+w+'" height="'+h+'" id="'+id+'">';
	code+='<param name="menu" value="false" /><param name="wmode" value="transparent" /><embed wmode="transparent" />';
	for(var x=args.length-1;x>4;x--)
	{
		p=args[x];
		pos=p.indexOf('=');
		code+='<param name="'+p.substr(0,pos)+'" value="'+p.substr(pos+1)+'" />';
	}
	code+=alt+'</object>';
	document.write(code);
}

var timeout	= 0;
var closetimer	= 0;

function mclose()
{
	document.getElementById('sub').style.display='none';
	document.getElementById('sub1').style.display='none';
}
function mstay(){
	document.getElementById('sub').style.display='block';
	document.getElementById('sub1').style.display='block';
}
function mclosetime()
{
	closetimer = window.setTimeout(mclose,timeout);
}

function mcancelclosetime()
{
if(closetimer)
{
	window.clearTimeout(closetimer);
	closetimer = 0;
}
}






function mclose2()
{
	document.getElementById('sub').style.display='none';
	document.getElementById('sub1').style.display='none';
}
function mclosetime2()
{
	closetimer = window.setTimeout(mclose2,timeout);
}
function mcancelclosetime2()
{

if(closetimer)
{
	window.clearTimeout(closetimer);
	closetimer = 0;
}
}

function mclose1()
{
	document.getElementById('sub1').style.display='none';
}
function mclosetime1()
{
	closetimer = window.setTimeout(mclose1, timeout);
}
function mcancelclosetime1()
{
if(closetimer)
{
	window.clearTimeout(closetimer);
	closetimer = 0;
}
}


function mclose3()
{
	document.getElementById('sub3').style.display='none';
}
function mclosetime3()
{
	closetimer = window.setTimeout(mclose3,timeout);
}
function mcancelclosetime3()
{
if(closetimer)
{
	window.clearTimeout(closetimer);
	closetimer = 0;
}
}


document.onclick = mclose;



function checkCheckBoxes() {
	if (document.frmTest.chk1.checked == false)
		{
		alert ('You didn\'t choose any of the checkboxes!');
		return false;
		}
	else
		{
		return true;
		}
	}
 


function show(ptr){
	var obj = document.getElementById(ptr);if(obj)obj.style.display = 'block';
}
	
function hide(ptr){
	var obj = document.getElementById(ptr);
	if(obj)obj.style.display = 'none';
}
		
function radioChk(p1,p2){
		//var eS = document.getElementById(exampleS); 
		
		//if(eS)eS.innerHTML=\"".$sample_text2."\";
		var stype = document.getElementById("stype");
		
		
		switch(p2){
			case true:
				//stype.checked = true;
				stype.value = '1';
			break;
			default:
				//stype.checked = true;
				stype.value = '0';
			break;
		}
		
		//alert('stype checked = '+stype.checked+' value='+stype.value);
}
