﻿function $(obj){return document.getElementById(obj);}
function setCookie(name, value) {
   var today = new Date()
   var expires = new Date()
   expires.setTime(today.getTime() + 1000*60*60*24*365)
   document.cookie = name + "=" + escape(value)    + "; expires=" + expires.toGMTString()
}

function getCookie(Name) {
  var search = Name + "="
  if(document.cookie.length > 0) {
    offset = document.cookie.indexOf(search)
    if(offset != -1) {
      offset += search.length
      end = document.cookie.indexOf(";", offset)
      if(end == -1) end = document.cookie.length
      return unescape(document.cookie.substring(offset, end))
    }
    else return ""
  }
}
function allcheckbox(inputname,obj){
var getname=document.getElementsByName(inputname);
for (var i=0;i<getname.length;i++){
getname[i].checked=obj.checked;	
}
}
function checkallbox(obj){
var alldelid=document.getElementsByName("DelId");
for (var i=0;i<alldelid.length;i++){
	alldelid[i].checked=obj.checked;
	toallid(obj.checked,alldelid[i].value);
}
}
function toallid(checked,values){
	var allidvalue=document.getElementById("allid").value;
	if(checked){
	if(allidvalue.indexOf(","+values+",")==-1){
document.getElementById("allid").value=allidvalue+values+","
	}
	}else{
document.getElementById("allid").value=allidvalue.replace(","+values+",",",");
	}
}
function sendform(url){
document.getElementById("allform").action=url;
document.getElementById("allform").submit();
}
function opennew(url,name,width,height,top,left){
if(width==0){width=screen.availWidth;}
if(height==0){height=screen.availHeight;}
if(document.all){
showModelessDialog(url,name,"dialogWidth:"+width+"px;dialogHeight:"+height+"px;dialogLeft:"+top+"px;dialogTop:"+left+"px;center:yes;help:no;resizable:no;status:no;scroll:auto;"); 
}else{ 
window.open(url,name,"status=no,helpIcon=no,location=no,toolbar=no,menubar=no,maxnimize=no,systemMenu=no,resizable=no,scrollbars=auto,width="+width+",height="+height+",top="+top+",left="+left+"");} 
}
function openfull(url,name,width,height,top,left){
if(width==0){width=screen.availWidth;}
if(height==0){height=screen.availHeight;}
window.open(url,name,"status=no,helpIcon=no,location=no,toolbar=no,menubar=no,maxnimize=no,systemMenu=no,resizable=no,scrollbars=yes,width="+width+",height="+height+",top="+top+",left="+left+"");
}
function showflash(name,swf,width,height,bgcolor){ 
if(bgcolor==null||bgcolor==""){var transparent="opaque"}else{var transparent="transparent"}
var showtext="<object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\"http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0\" width=\""+width+"\" height=\""+height+"\" id=\""+name+"\" align=\"middle\">\n"; 
showtext=showtext+"<param name=\"allowScriptAccess\" value=\"sameDomain\" />\n"; 
showtext=showtext+"<param name=\"movie\" value=\""+swf+"\" />\n"; 
showtext=showtext+"<param name=\"menu\" value=\"false\" />\n"; 
showtext=showtext+"<param name=\"quality\" value=\"high\" />\n"; 
showtext=showtext+"<param name=\"scale\" value=\"exactfit\" />\n"; 
showtext=showtext+"<param name=\"wmode\" value=\""+transparent+"\" />\n"; 
showtext=showtext+"<param name=\"bgcolor\" value=\""+bgcolor+"\" />\n"; 
showtext=showtext+"<embed src=\""+swf+"\" menu=\"false\" quality=\"high\" scale=\"exactfit\" wmode=\""+transparent+"\" bgcolor=\""+bgcolor+"\" width=\""+width+"\" height=\""+height+"\" name=\""+name+"\" align=\"middle\" allowScriptAccess=\"sameDomain\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" />\n"; 
showtext=showtext+"</object>\n"; 
document.write (showtext); 
}
function changebgcolor(obj,color){
obj.style.backgroundColor=color;
}
function showindex(){
document.write('<object classid=clsid:d27cdb6e-ae6d-11cf-96b8-444553540000 codebase=http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0 width='+ focus_width +' height='+ swf_height +'>'); 
document.write('<param name=allowScriptAccess value=sameDomain><param name=movie value=picflash.swf><param name=quality value=high><param name=bgcolor value=#DADADA>'); 
document.write('<param name=menu value=false><param name=wmode value=opaque>'); 
document.write('<param name=FlashVars value="pics='+pics+'&links='+links+'&texts='+texts+'&borderwidth='+focus_width+'&borderheight='+focus_height+'&textheight='+text_height+'">'); 
document.write('<embed src=picflash.swf wmode=opaque FlashVars="pics='+pics+'&links='+links+'&texts='+texts+'&borderwidth='+focus_width+'&borderheight='+focus_height+'&textheight='+text_height+'" menu=false bgcolor=#DADADA quality=high width="'+ focus_width +'" height="'+ swf_height +'" allowScriptAccess=sameDomain type=application/x-shockwave-flash pluginspage=http://www.macromedia.com/go/getflashplayer />'); 
document.write('</object>');	
}