﻿CheckLoadJsCssFile("/css/gb.css", "css")
var GB_window={};
GB_window.closeWindow=function(){
	document.body.removeChild(document.body.lastChild);
}

GB_window.resize=function(){
	var GB_outer = document.getElementById("GB_outer");
	if(document.getElementById("GB_outer")){
		if(window.innerWidth){
			screenWidth=window.innerWidth;
			screenHeight=window.innerHeight;
		
		} else if (document.documentElement && document.documentElement.clientHeight) {
			screenWidth = document.documentElement.clientWidth;
			screenHeight = document.documentElement.clientHeight;
		} else if (document.body) {
			screenWidth = document.body.clientWidth;
			screenHeight = document.body.clientHeight;	
		}else {
			// alert(screen.availHeight);
			screenWidth=screen.availWidth;
			screenHeight=screen.availHeight;
		}
		var rH=(document.documentElement.clientHeight>document.body.clientHeight?document.documentElement.clientHeight:document.body.clientHeight)-screenHeight;
		GB_outer.style.width=(document.documentElement.clientWidth>document.body.clientWidth?document.documentElement.clientWidth:document.body.clientWidth)+"px";
		GB_outer.style.height=(document.documentElement.clientHeight>document.body.clientHeight?document.documentElement.clientHeight:document.body.clientHeight)+"px";
	}
}

GB_window.create_GrayBox=function(head_str,innerUrl,height,width){
	window.onresize = GB_window.resize;
	
	var scrOfX = 0, scrOfY = 0;
	if( typeof( window.pageYOffset ) == 'number' ) {
		//Netscape compliant
		scrOfY = window.pageYOffset;
		scrOfX = window.pageXOffset;
	} else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) {
		//DOM compliant
		scrOfY = document.body.scrollTop;
		scrOfX = document.body.scrollLeft;
	} else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) {
		//IE6 standards compliant mode
		scrOfY = document.documentElement.scrollTop;
		scrOfX = document.documentElement.scrollLeft;
	}
	$(document).scroll( function() {
		//GB_window.GB_outer.style.width=document.body.clientWidth+"px";
		//GB_window.GB_outer.style.height=document.body.clientHeight+"px";
		//GB_window.GB_outer.style.backgroundImage="url(/images/alphaBg.png)";
	}); 
	//window.scrollTo(0,0);
	GB_window.width=width;
	GB_window.height=height;
	var GB_box;
	var screenWidth, screenHeight;
	//var headerBg="/images/SS_header.gif";
	var headerW=35;
	var headerH=35;
	//var alphaBG="/images/alphaBg.png";
	//var closeBt="/images/w_close_3.gif";
	//var bordercolor="#bfe8fe";
	//var windowBoardWidth=1;
	
	if(window.innerWidth){
		screenWidth=window.innerWidth;
		screenHeight=window.innerHeight;
		
	} else if (document.documentElement && document.documentElement.clientHeight) {
		screenWidth = document.documentElement.clientWidth;
		screenHeight = document.documentElement.clientHeight;
	} else if (document.body) {
		screenWidth = document.body.clientWidth;
		screenHeight = document.body.clientHeight;	
	}else {
		//alert(screen.availHeight);
		screenWidth=screen.availWidth;
		screenHeight=screen.availHeight;
	}
	
	//alert("1:"+window.innerHeight+" 2:"+document.documentElement.clientHeight+" 3:"+document.body.clientHeight+" 4:"+screen.availHeight);
	
	var rH=(document.documentElement.clientHeight>document.body.clientHeight?document.documentElement.clientHeight:document.body.clientHeight)-screenHeight;
	//alert(rH);
	if(!document.createElement){
		//alert('!document.createElement');
		return true;
	}
	
	try{
		GB_window.GB_outer=document.createElement('div');
		GB_window.GB_outer.setAttribute('id','GB_outer');
		GB_window.GB_outer.setAttribute('name','GB_outer');
		//GB_window.GB_outer.style.position='absolute';
		GB_window.GB_outer.className="gb_outer";
		//GB_window.GB_outer.style.top="0px";
		//GB_window.GB_outer.style.left="0px";
		//GB_window.GB_outer.style.bottom="0px";
		//GB_window.GB_outer.style.right="0px";
		
		GB_window.GB_outer.style.width=(document.documentElement.clientWidth>document.body.clientWidth?document.documentElement.clientWidth:document.body.clientWidth)+"px";
		GB_window.GB_outer.style.height=(document.documentElement.clientHeight>document.body.clientHeight?document.documentElement.clientHeight:document.body.clientHeight)+"px";
		//GB_window.GB_outer.style.overflow="hidden";
		//GB_window.GB_outer.style.backgroundImage="url("+alphaBG+")";
		//GB_window.GB_outer.style.margin="0px auto";
		//GB_window.GB_outer.style.behavior="url(/images/iepngfix.htc)";
		//GB_window.GB_outer.style.zIndex="5000";
		
		//GB_window.GB_outer.innerHTML="<img src='/images/space1.gif' style='width:"+document.documentElement.clientWidth+"px; height:"+document.documentElement.clientHeight+"px;'/>";
		
			
		GB_box=document.createElement('div');
		GB_box.setAttribute('id','GB_box');
		GB_box.setAttribute('name','GB_box');
		GB_box.className="gb_box";
		//GB_box.style.position='relative';
		var m_h=(screenHeight-GB_window.height-headerH)/2+scrOfY;
		//GB_box.style.margin=m_h+"px auto "+(rH+m_h)+"px auto";	
		GB_box.style.margin=m_h+"px auto auto auto";

		//GB_box.style.width=(GB_window.width+windowBoardWidth*2)+"px";
		//GB_box.style.height=(GB_window.height+headerH+windowBoardWidth*2)+"px";
		GB_box.style.width=(GB_window.width)+"px";
		GB_box.style.height=(GB_window.height+headerH)+"px";
		//GB_box.style.overflow="visible";
		//GB_box.style.backgroundColor="#808080";
		//GB_box.style.border=windowBoardWidth+"px solid "+bordercolor;
		//GB_box.style.border="0px";
		
		
		var GBinnerHTML="<table width="+GB_window.width+" border='0px' cellspacing='0px' cellpadding='0px' style='width:"+GB_window.width+"px;' class='gb_table'>";
		GBinnerHTML+="<tr><td width="+GB_window.width+" height='"+headerH+"' class='gb_header' align='left'>&nbsp;&nbsp;"+head_str;
		GBinnerHTML+="<div style='left: "+(GB_window.width-headerW-1)+"px; width:"+headerW+"px; height:"+headerH+"px;' class='gb_close' onclick='GB_window.closeWindow()'></div></td></tr>";
		//GBinnerHTML+="<tr><td style='border:0px;' bgcolor='#FFFFFF'><iframe src='"+innerUrl+"' style='border: 0px; width:"+GB_window.width+"px; height:"+GB_window.height+"px; margin:0 0 0 0;' scrolling='yes'></iframe></td></tr></table>";
		GBinnerHTML+="</table><iframe frameBorder='0' src='"+innerUrl+"' width='"+GB_window.width+"' height='"+GB_window.height+"' style='border: 0px; width:"+GB_window.width+"px; height:"+GB_window.height+"px; margin:0 0 0 0;' scrolling='no'></iframe>";
		GB_box.innerHTML=GBinnerHTML;
		
	}catch(exception){
		
	}
	//alert(GB_box.innerHTML);
	GB_window.GB_outer.appendChild(GB_box);
	document.body.appendChild(GB_window.GB_outer);
}

function GB_showCenter(head_str,innerUrl,height,width){
	return GB_window.create_GrayBox(head_str,innerUrl,height,width);
}

function GB_hide(){
	return GB_window.closeWindow();
}



var GB_notitle_window={};
GB_notitle_window.closeWindow=function(){
	document.body.removeChild(document.body.lastChild);
}

GB_notitle_window.resize=function(){
	var GB_outer = document.getElementById("GB_outer");
	if(document.getElementById("GB_outer")){
		if(window.innerWidth){
			screenWidth=window.innerWidth;
			screenHeight=window.innerHeight;
		
		} else if (document.documentElement && document.documentElement.clientHeight) {
			screenWidth = document.documentElement.clientWidth;
			screenHeight = document.documentElement.clientHeight;
		} else if (document.body) {
			screenWidth = document.body.clientWidth;
			screenHeight = document.body.clientHeight;	
		}else {
			// alert(screen.availHeight);
			screenWidth=screen.availWidth;
			screenHeight=screen.availHeight;
		}
		var rH=(document.documentElement.clientHeight>document.body.clientHeight?document.documentElement.clientHeight:document.body.clientHeight)-screenHeight;
		GB_outer.style.width=(document.documentElement.clientWidth>document.body.clientWidth?document.documentElement.clientWidth:document.body.clientWidth)+"px";
		GB_outer.style.height=(document.documentElement.clientHeight>document.body.clientHeight?document.documentElement.clientHeight:document.body.clientHeight)+"px";
	}
}

GB_notitle_window.create_GrayBox=function(innerUrl,height,width){
	window.onresize = GB_notitle_window.resize;
	
	var scrOfX = 0, scrOfY = 0;
	if( typeof( window.pageYOffset ) == 'number' ) {
		//Netscape compliant
		scrOfY = window.pageYOffset;
		scrOfX = window.pageXOffset;
	} else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) {
		//DOM compliant
		scrOfY = document.body.scrollTop;
		scrOfX = document.body.scrollLeft;
	} else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) {
		//IE6 standards compliant mode
		scrOfY = document.documentElement.scrollTop;
		scrOfX = document.documentElement.scrollLeft;
	}
	$(document).scroll( function() {

	}); 
	//window.scrollTo(0,0);
	GB_notitle_window.width=width;
	GB_notitle_window.height=height;
	var GB_box;
	var screenWidth, screenHeight;
	
	if(window.innerWidth){
		screenWidth=window.innerWidth;
		screenHeight=window.innerHeight;
		
	} else if (document.documentElement && document.documentElement.clientHeight) {
		screenWidth = document.documentElement.clientWidth;
		screenHeight = document.documentElement.clientHeight;
	} else if (document.body) {
		screenWidth = document.body.clientWidth;
		screenHeight = document.body.clientHeight;	
	}else {
		screenWidth=screen.availWidth;
		screenHeight=screen.availHeight;
	}
	
	
	var rH=(document.documentElement.clientHeight>document.body.clientHeight?document.documentElement.clientHeight:document.body.clientHeight)-screenHeight;
	if(!document.createElement){
		return true;
	}
	
	try{
		GB_notitle_window.GB_outer=document.createElement('div');
		GB_notitle_window.GB_outer.setAttribute('id','GB_outer');
		GB_notitle_window.GB_outer.setAttribute('name','GB_outer');
		GB_notitle_window.GB_outer.className="gb_notitle_outer";
		
		GB_notitle_window.GB_outer.style.width=(document.documentElement.clientWidth>document.body.clientWidth?document.documentElement.clientWidth:document.body.clientWidth)+"px";
		GB_notitle_window.GB_outer.style.height=(document.documentElement.clientHeight>document.body.clientHeight?document.documentElement.clientHeight:document.body.clientHeight)+"px";

			
		GB_box=document.createElement('div');
		GB_box.setAttribute('id','GB_box');
		GB_box.setAttribute('name','GB_box');
		GB_box.className="gb_notitle_box";
		var m_h=(screenHeight-GB_notitle_window.height)/2+scrOfY;
		GB_box.style.margin=m_h+"px auto auto auto";

		GB_box.style.width=(GB_notitle_window.width)+"px";
		GB_box.style.height=(GB_notitle_window.height)+"px";
		
		var GBinnerHTML="<iframe frameBorder='0' src='"+innerUrl+"' width='"+GB_notitle_window.width+"' height='"+GB_notitle_window.height+"' style='border: 0px; width:"+GB_notitle_window.width+"px; height:"+GB_notitle_window.height+"px; margin:0 0 0 0;' scrolling='no'></iframe>";
		GB_box.innerHTML=GBinnerHTML;
		
	}catch(exception){
		
	}
	GB_notitle_window.GB_outer.appendChild(GB_box);
	document.body.appendChild(GB_notitle_window.GB_outer);
}