﻿

function navigation_onclick(type)
   {
    	var object = document.getElementById(type);
     if (type=="select")
	 {
	    object.className ="mixtable_ing"; 
		document.getElementById("add").className="navigation";
		document.getElementById("selectTB").style.display = "block";
		document.getElementById("addTB").style.display = "none";
	  }
    if (type=="add")
	 {

	    object.className ="mixtable_ing"; 
		document.getElementById("select").className="navigation";	  
		document.getElementById("selectTB").style.display = "none";
		document.getElementById("addTB").style.display = "block";
	}
   }
 function ShowDetail(N)
{
	N = N - 1;
	var img = document.getElementsByName("add");
	var object = document.getElementsByName("detail");
	if(img.length >=1)
	{
		if(img[N].innerText == "+")
		{
			for(var i = 0 ; i < document.getElementsByName("detail").length ; i++)
			{
				img[i].innerText = "+";
				object[i].style.display = "none";
			}
			img[N].innerText = "-";
			object[N].style.display = "block";
		}
		else
		{
				img[N].innerText = "+";
				object[N].style.display = "none";
		}
	}
} 
function changeHeight()
{
   if (parent.document.getElementById("ibody")!=null)
   {
   		//alert(parent.document.getElementById("ibody").height);
		parent.document.getElementById("ibody").height = document.body.scrollHeight;
   }
   
   if (parent.document.getElementById("resultbody")!=null)
   {
		parent.document.getElementById("resultbody").height = document.body.scrollHeight;
	   if (parent.parent.document.getElementById("ibody")!=null)
	   	{
			parent.parent.document.getElementById("ibody").height = parent.document.body.scrollHeight;
		}
   }
   if (parent.document.getElementById("ioption")!=null)
   {
		parent.document.getElementById("ioption").height = document.body.scrollHeight;
	   if (parent.parent.document.getElementById("ibody")!=null)
	   	{
			parent.parent.document.getElementById("ibody").height = parent.document.body.scrollHeight;
		}
   }   
   if (parent.document.getElementById("resultbody")!=null)
   {
		parent.document.getElementById("resultbody").height = document.body.scrollHeight;
	   if (parent.parent.document.getElementById("ioption")!=null)
	   	{
			parent.parent.document.getElementById("ioption").height = parent.document.body.scrollHeight;
		   if (parent.parent.parent.document.getElementById("ibody")!=null)
	   		{
				parent.parent.parent.document.getElementById("ibody").height = parent.parent.document.body.scrollHeight;
			}
		}
   }
}
//
function S_formSubmit(){
		if (parent.document.getElementById("formSecord")!=null)
	{
		parent.document.getElementById("formSecord").value="1";
	}
	//parent.document.getElementById("formSecord").value=1;
}
//function  F_formSubmit(){
//	if(document.getElementById("formSecord").value==1){
		//form.submit();
		//document.getElementById("formSecord").value=0;
		//return true;
	//}
	//return false;

function  F_formSubmit(){
if (document.getElementById("formSecord").value=="1")
	{
			document.getElementById("formSecord").value="0";
			return true;
	}	
	else
	{	

			return false;
	}
	return true;
}
function doCheckAllDel(hidOBJ,thisOBJ,OBJ){
var h_idobj=document.getElementsByName(hidOBJ);
var thisobj=document.getElementById(thisOBJ);
var obj=document.getElementsByName(OBJ);
   if(thisobj.checked==true){  
    for(i=0;i<obj.length;i++){
	if(obj[i].disabled==false)
	{
		//for(j=0;j<h_idobj.length;j++)
		//{
			if (h_idobj[i].checked==false)
			{
			obj[i].checked=true;
			}
		//}
	}
    }
	}
	else{
	for(i=0;i<obj.length;i++){
	if(obj[i].disabled==false)
    obj[i].checked=false;
    }
	}
	
}

function doCheckAllDel_DisUp(thisOBJ,OBJ){
var thisobj=document.getElementById(thisOBJ);
var obj=document.getElementsByName(OBJ);
   if(thisobj.checked==true){  
    for(i=0;i<obj.length;i++){
	if(obj[i].disabled==false)
	{
			obj[i].checked=true;
	}
    }
	}
	else{
	for(i=0;i<obj.length;i++){
	if(obj[i].disabled==false)
    obj[i].checked=false;
    }
	}
	
}

 function confirmDel(objs){
  var delobj = document.getElementsByName(objs);
  for(i=0;i<delobj.length;i++){
    	 if(delobj[i].checked==true)
	 	{
    	  if((locale=="zh_CN") || (locale=="ch_cn"))
		  {
			 if(confirm("确定删除吗？"))
	   			{
	  				 return true;
	   			}else 
	  			 {
				   return false; 
	 			  }
				  
		  }else
		  {
			 	 if(confirm("The determination deletion？"))
	   			{
	  				 return true;
	   			}else 
	  			 {
				   return false; 
	 			  } 
		  }
		}//end if
  }//end for
  return true;
 }
 
function sessionHref()
{
  if((locale=="zh_CN") || (locale=="ch_cn"))
  {
	   alert("超时退出");
  }else
  {
	   alert("Session TimeOut");
   }
 	 parent.parent.parent.parent.parent.document.location = '/';
}

function errHref()
{
 parent.parent.parent.parent.parent.document.location = '/';
}

function screensize()
{
var correctwidth=1024;
var correctheight=768;
//alert(locale);
if (screen.width!=correctwidth||screen.height!=correctheight)
{
	//alert(locale);
   if((locale=="zh_CN") || (locale=="ch_cn"))
  {
	alert("最佳分辨率: "+correctwidth+"*"+correctheight+". "+screen.width+"*"+screen.height+"。设置合适的分辨率才能取得最佳的显示效果！");
  }else
  {
    alert("Best distinguished rate: "+correctwidth+"*"+correctheight+". the current distinguished rate for you is:"+screen.width+"*"+screen.height+"。Setting the appropriate distinguished rate to be able to obtain best demonstration effect)！");
   }
}
}
function ieNavigator()
{
	//alert(window.navigator.appName);
	//alert(locale);
	//alert(window.navigator.appName.toString());
if (window.navigator.appName.toString()!="Microsoft Internet Explorer")
{
	
  if((locale=="zh_CN") || (locale=="ch_cn"))
  {
	alert("您的浏览器版本不是Microsoft Internet Explorer，在使用过程中可能导致无法正常使用该系统,请用IE6或者以上版本！");
	document.location = '/';
  }else
  {
     alert(" Your browser edition is not Microsoft Internet Explorer, possibly causing in the using process to be unable normally to use this system,   please use IE6 or above the edition！");	  
	 document.location = '/';
  }
}
  var Ie_ver=navigator["appVersion"].substr(22,1);
  if (parseInt(Ie_ver,10) < 6)
  {
   if((locale=="zh_CN") || (locale=="ch_cn"))
   {
      alert("您的浏览器版本低于6.0，导致无法正常使用该系统请用IE6.0或者以上版本！");
	   document.location = '/';
   }else
   {
      alert("Your browser edition is lower than 6.0, causes to be unable normally to use this system please to use IE6.0 or above the edition！");
	   document.location = '/';
   }	 
 }
}
