//==========================================================================
//  winOpen
//==========================================================================
function winOpen(url, name, w, h) {
	var H = screen.width/2 -(w/2);
	var V = screen.height/2 -(h/2);
	window.open(url,name,'width='+w+',height='+h+',scrollbars=0,resizable=0,menubar=0,toolbar=0,status=0,location=0,directories=0,left='+H+',top='+V+'').focus();
}

function winOpen2(url, name, w, h) {
	var H = screen.width/2 -(w/2);
	var V = screen.height/2 -(h/2);
	window.open(url,name,'width='+w+',height='+h+',scrollbars=1,resizable=1,menubar=0,toolbar=0,status=0,location=0,directories=0,left='+H+',top='+V+'').focus();
}

function winOpen3(url, name, w, h) {
	var H = screen.width/2 -(w/2);
	var V = screen.height/2 -(h/2);
	window.open(url,name,'width='+w+',height='+h+',scrollbars=1,resizable=1,menubar=0,toolbar=0,status=0,location=0,directories=0,left='+H+',top='+V+'').focus();
}

//==========================================================================
//  winOpenFull
//==========================================================================
function winOpenFull(_url,popupName) {
	var hash = new String(window.location.hash);
	var search =new String(window.location.search);
	
	var app_ver = navigator.appVersion;
	var app_name  = navigator.appName;
	var pos    = app_ver.indexOf("MSIE",0);
	
	if(app_ver.indexOf("Win")>=0){ 
		//Win
		if(app_name.indexOf("Microsoft")>=0){ 
			//IE
			if (app_name == "Microsoft Internet Explorer" && parseInt(app_ver)>=4){ //IEversion more 4
				if(parseInt(app_ver.slice(pos+5,pos+6))>=6){
					if(parseInt(app_ver.indexOf("Windows NT 5.1",0)) > 0){ 
						//XP
						var popupWindow = window.open(_url ,popupName,"width=" + (screen.availWidth) + ",height=" + (screen.availHeight-31) + ",toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0");
						if(popupWindow){
							popupWindow.focus();
						}
					}else{ 
						popupWindow = window.open(_url ,popupName,"width=" + (screen.availWidth) + ",height=" + (screen.availHeight-23) + ",toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0");
						if(popupWindow){
							popupWindow.focus();
						}
					}
				}else{
					popupWindow = window.open("" ,popupName,"fullscreen=1,width=" + (screen.availWidth+3) + ",height=" + (screen.availHeight+1) + ",toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0");
					if(popupWindow){
						popupWindow.resizeTo(Math.ceil(screen.availWidth+3),Math.ceil(screen.availHeight+1));
						popupWindow.moveTo(0,0);
						popupWindow.document.open("text/html", "replace");
						popupWindow.document.write("<html><style type='text/css'>\n");
						popupWindow.document.write("body{ border: 1px solid #000000; overflow: hidden; margin: 0pt;}");
						popupWindow.document.write("#stillloadingDiv{ position: absolute; left: 0px; top: 0px; width: 100%px; height: 19px; z-index: 1; background-color: #C0C0C0; layer-background-color: #C0C0C0; clip:rect(0,100%,19,0);}");
						popupWindow.document.write("</style>\n");
						popupWindow.document.write("<body onload=\"top.document.location.replace('"+_url+"')\" topmargin=0 leftmargin=0 marginwidth=0 marginheight=0 scroll='no'>");
						popupWindow.document.write("<div ID='stillloadingDiv'></div>");
						popupWindow.document.write("</body></html>");
						popupWindow.document.close();
						popupWindow.focus();
					}
				}
			}else{ 
				//IE4ȉ
				popupWindow = window.open(_url,popupName,"width=" + (screen.availWidth+1) + ",height=" + (screen.availHeight-21) + ",toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=1,left=0,top=0,screenX=0,screenY=0",true);
				if(popupWindow){
					
				}
			}
		}else if(app_name.indexOf("Netscape")>=0){ 
			//NN
			popupWindow = window.open("",popupName,"scrollbars=0,resizable=0,outerWidth=" + screen.availWidth +",outerheight=" + screen.availHeight +",top=0,left=0");
			if(popupWindow){
				popupWindow.moveBy(0,-10);
				popupWindow.location.href = _url;
			}
		}else{
			//Opera
				popupWindow = window.open("",popupName,"scrollbars=0,resizable=0,outerWidth=" + screen.availWidth +",outerheight=" + screen.availHeight +",top=0,left=0");
			if(popupWindow){
				popupWindow.moveBy(0,-10);
				popupWindow.location.href = _url;
				popupWindow.focus();
			}
				}
	}else if(app_ver.indexOf("Mac")>=0){ 
		//Mac
		if(app_ver.indexOf("Safari")>=0){ 
			//Safari
			popupWindow=window.open("",popupName,"scrollbars=0,resizable=0,width=" + (screen.availWidth) +",height=" + (screen.availHeight-20));
			if(popupWindow){
				popupWindow.moveTo(0,0);
				popupWindow.location.href=_url;
			}
		}else{
			if(app_name.indexOf("Microsoft")>=0){ 
				//IE
				popupWindow = window.open(_url,popupName,"alwaysLowered=0,alwaysRaised=0,channelmode=0,dependent=1,directories=0,fullscreen=1,hotkeys=1,location=0,menubar=0,resizable=0,scrollbars=0,status=0,titlebar=0,toolbar=0,z-lock=0,screenX=0,screeny=0,left=0,top=0");
				if(popupWindow){
					popupWindow.resizeTo(screen.availWidth,screen.availHeight);
					
				}
			}else if(app_name.indexOf("Netscape")>=0){ 
				//NN
				popupWindow=window.open("",popupName,"scrollbars=0,resizable=0,width=" + (screen.availWidth-12) +",height=" + (screen.availHeight-30));
				if(popupWindow){
					popupWindow.moveTo(0,0);
					popupWindow.location.href=_url;
				}
			}
		}
		
	}
}
