
<!--
function DispMeg(ButtonDiv,Titles,Megs,SrcOk,SrcCancle,Img,ButtonText,Types)
{
    HandleButton(ButtonDiv,"hidden");
	HandleSelect("hidden");
	var div = GetDiv(ButtonDiv+"megdiv");
	if (div)
	{
	    div.style.visibility = "visible";
	}else{
	    div = document.createElement("div");
	    div.innerHTML='\
	      <div class="wsmeg">\
               <div class="wsmeg_content_top">\
                    <div class="wsmeg_top_left">\
                        <div class="wsmeg_content_kk">'+Titles+'</div>\
                     </div>\
                    <div class="wsmeg_top_right">\
                        <div class="wsmeg_content_tt">\
						    <img src="/Images/MegIcon/Close.gif" onClick="CloseMegDiv(\''+ButtonDiv+'\');" alt="Close" width="14" height="14" />\
						</div>\
                    </div>\
               </div>\
               <div class="wsmeg_content_main">\
                    <div class="wsmeg_main_right">\
                        <div class="wsmeg_main_tt">'+Megs+'</div>\
                    </div>\
                    <div class="wsmeg_main_left">\
                        <div class="wsmeg_main_kk">\
						    <img src="'+Img+'"  />\
						</div>\
                    </div>\
               </div>\
               <div class="wsmeg_content_footer">\
                     <div class="wsmeg_footer_m">\
                         '+GetButton(Types,ButtonText,ButtonDiv,SrcOk,SrcCancle);+'\
                     </div>\
               </div>\
           </div>\
	    ';
	    div.style.background = "ffffff";
	    div.style.filter = "alpha(Opacity=100)";
	    div.style.width = 300;
	    div.style.height = 150;
	    div.style.lineHeight = "15px";
	    div.style.position = "absolute";
	    div.style.top=GetWidth()+((window.screen.availHeight-window.screenTop)/2)-130;
	    div.style.left = document.body.clientWidth/2-150;
	    div.style.zIndex = 101;
	    div.id= ButtonDiv+"megdiv";
	    document.body.appendChild(div);
	}
	
    var xScroll, yScroll;
    if (window.innerHeight && window.scrollMaxY){
       xScroll = document.body.scrollWidth;
       yScroll = window.innerHeight + window.scrollMaxY;
    } else if (document.body.scrollHeight > document.body.offsetHeight){
       xScroll = document.body.scrollWidth;
       yScroll = document.body.scrollHeight;
    } else { 
       xScroll = document.body.offsetWidth;
       yScroll = document.body.offsetHeight;
    }
         
    var windowWidth, windowHeight;
    if (self.innerHeight) {
       windowWidth = self.innerWidth;
       windowHeight = self.innerHeight;
    } else if (document.documentElement && document.documentElement.clientHeight) {
       windowWidth = document.documentElement.clientWidth;
       windowHeight = document.documentElement.clientHeight;
    } else if (document.body) { 
       windowWidth = document.body.clientWidth;
       windowHeight = document.body.clientHeight;
    }
	   
	if(yScroll < windowHeight){
        h = windowHeight;
    } else {
        h = yScroll;
    }
           
    if(xScroll < windowWidth){
        w = windowWidth;
    } else {
        w = xScroll;
    }
	
    var bgdiv = GetDiv("megbgdiv");
	if (bgdiv)
	{
	    bgdiv.style.visibility = "visible";
	}else{
	    bgdiv = document.createElement("div");
	    bgdiv.style.background = "black";
	    bgdiv.style.filter = "alpha(Opacity=30)";
	    bgdiv.style.position = "absolute";
	    bgdiv.style.top = "0";
	    bgdiv.style.left = "0";
	    bgdiv.style.width = w;
	    bgdiv.style.height = h;
	    bgdiv.style.zIndex = 100;
	    bgdiv.id="megbgdiv";
	    document.body.appendChild(bgdiv);
	}
	//bgdiv.focus();
}

function CloseMegDiv(ButtonNames)
{
   //window.location.reload(true);
   //history.back(-1);
    HandleDiv(ButtonNames+"megdiv");
    HandleDiv("megbgdiv");
    HandleSelect("visible");
    HandleButton(ButtonNames,"visible");
}
function HandleSelect(States)
{
    var sels = document.getElementsByTagName("SELECT");
	for(var i=0; i<sels.length; i++)
	{
	  sels[i].style.visibility = States;
	}
}
function HandleDiv(ButtonNames)
{
  d = GetDiv(ButtonNames);
  if (d)
  {
    if (document.layers) d.visibility = "hide";
	else d.style.visibility = "hidden";
  }else{
  alert(ButtonNames);
  }
}
function HandleButton(ButtonNames,States)
{
  d = GetDiv(ButtonNames);
  if (d)
  {
	 d.style.visibility = States;
  }
}
function GetDiv(sDiv)
{
	var div;
	if (document.getElementById)
		div = document.getElementById(sDiv);
	else if (document.all)
		div = eval("window." + sDiv);
	else if (document.layers)
		div = document.layers[sDiv];
	else
		div = null;
	return div;
}
function GetWidth()
{		
    var scrollPos; 
    if (typeof window.pageYOffset != 'undefined') { 
       scrollPos = window.pageYOffset; 
    }else if (typeof document.compatMode != 'undefined' && document.compatMode != 'BackCompat') { 
      scrollPos = document.documentElement.scrollTop; 
    }else if (typeof document.body != 'undefined') { 
      scrollPos = document.body.scrollTop; 
    } 
    return scrollPos;
}
function OpenModalDialog(Url,Width,Height,WindowObj)
{
	var ReturnStr=showModalDialog(Url,WindowObj,'dialogWidth:'+Width+'pt;dialogHeight:'+Height+'pt;status:no;help:no;scroll:no;');
	return ReturnStr;
}
function OpenMake(url)
{
    newwin=window.open('about:blank','Make','width=500,height=400,resizable=1,scrollbars=1');
    if (document.all){
        newwin.moveTo(screen.width/2-200,screen.height/2-180)
    }
	myform.action=url;
	myform.target='Make';
	myform.submit();
}
function GetButton(types,ButtonText,ButtonDiv,SrcOk,SrcCancle)
{
    var bstr;
	var cstr;
	bstr='<input name="WsSave" class="buttonout" onmouseover="this.className=\'buttonover\'" onmouseout="this.className=\'buttonout\'" type="button" value="'+ButtonText+'"'
	cstr='<input name="WsCancle" class="buttonout" onmouseover="this.className=\'buttonover\'" onmouseout="this.className=\'buttonout\'" type="button" value=" Cancle "'
    if (types == 0) {
         bstr+=' onclick="CloseMegDiv(\''+ButtonDiv+'\');" />';
    }else if (types == 1){
         bstr+=' onclick="CloseMegDiv(\''+ButtonDiv+'\');window.close();" />';
    }else if (types == 2){
         bstr+=' onclick="CloseMegDiv(\''+ButtonDiv+'\'); if(window.dialogArguments != null){window.dialogArguments.location.reload(true);} window.close();" />';
    }else if (types == 3){
         bstr+=' onclick="CloseMegDiv(\''+ButtonDiv+'\'); if(window.dialogArguments != null){window.dialogArguments.location.reload(true);} window.close();" />';
    }else if (types == 4){
         bstr+=' onclick="CloseMegDiv(\''+ButtonDiv+'\'); window.location=\''+SrcOk+'\';" />';
    }else if (types == 5){
         bstr+=' onclick="CloseMegDiv(\''+ButtonDiv+'\');history.back();" />';
    }else if (types == 6){
         bstr+=' onclick="CloseMegDiv(\''+ButtonDiv+'\');__doPostBack('+SrcOk+');" />';
    }else if (types == 7){
         bstr+=' onclick="CloseMegDiv(\''+ButtonDiv+'\');__doPostBack('+SrcOk+');" />&nbsp;&nbsp;'+cstr+' onclick="CloseMegDiv(\''+ButtonDiv+'\');__doPostBack('+SrcCancle+');" />';
    }else if (types == 8){
         bstr+=' onclick="CloseMegDiv(\''+ButtonDiv+'\');window.location=\''+SrcOk+'\';" />&nbsp;&nbsp;'+cstr+' onclick="CloseMegDiv(\''+ButtonDiv+'\');window.location=\''+SrcCancle+'\';" />';
    }else if (types == 9){
         bstr+=' onclick="CloseMegDiv(\''+ButtonDiv+'\');OpenMake(\''+SrcOk+'\');" />&nbsp;&nbsp;'+cstr+' onclick="CloseMegDiv(\''+ButtonDiv+'\');" />';
    }else if (types == 10){
         bstr+=' onclick="CloseMegDiv(\''+ButtonDiv+'\');OpenModalDialog('+SrcOk+');" />&nbsp;&nbsp;'+cstr+' onclick="CloseMegDiv(\''+ButtonDiv+'\');OpenMake(\''+SrcCancle+'\');" />';
    }else if (types == 11){
         bstr='';
         if (SrcOk != ""){
            copytext(SrcOk);
         }
    }else if (types == 12){
         bstr='';
         copytext(SrcOk);
    }else{
         bstr='';
    }
    return bstr;
}
//-->
