/*
window.onload=loadinit();
function loadinit(){
	if(document.readyState == 'complete') {
		init();
		}
	}*/
function init(){
var obj,top,left,W,H,menu;
obj=document.getElementById('Image1');
menu=document.getElementById('menu1');
var Rec=obj.getBoundingClientRect();
left=Rec.left;
H=obj.clientHeight;
W=obj.clientWidth;
top=Rec.top;
 menu.style.position="absolute";
 menu.style.top=(top+H-10)+"px";
 menu.style.left=left+"px";
}

/*****
* indexinit
*/
function indexinit(){
	
}


function GETURL(url_){
window.location.href=url_;
}
function ConfirmDel(str)//调用提示的 
{
   if(confirm(str))
     return true;
   else
     return false; 
}
function checkForm(form){//检验表单是否为空
			  var obj=document.getElementById(form);
			  
			  if(Validator.Validate(obj,3)){
			  obj.submit();
			  }
			  }
function LoadObject(movie,height,width,id,mode,vars) //后面的vars是带的参数  
{ 
document.write("<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' height='"+height+"' width='"+width+"' id='"+id+"' name='"+id+"' Viewastext>"); 
document.write("<param name='allowScriptAccess' value='sameDomain'/>");
document.write("<param name='movie' value='"+movie+"' />");
document.write("<param name='quality' value='high' />");
document.write("<param name='Flashvars' value='"+vars+"' />");
if(mode){
document.write("<param name='wmode' value='opaque'/>");
}
document.write("<embed src='"+movie+"' quality='high' width='"+width+"' height='"+height+"' name='"+id+"' swLiveConnect='true'  align='middle' allowScriptAccess='sameDomain' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' />"); 
document.write("</object>"); 
}

function showImg(){ 
  document.getElementById("cut_img").src=document.getElementById("upfiles[]").value; 

}  
function showImg2(){ 
  document.getElementById("cut_img").src=document.getElementById("upfiles").value; 

}  
function showImgsmll(smailpic){ 

  var obj=document.getElementById("small_pic_view");
  var ovi=document.getElementById("small_pic");
  obj.src=smailpic;
  ovi.value=smailpic;
}  
function small1(){
var height1=images1.height
var width1=images1.width
images1.height=height1/1.5
images1.width=width1/1.5
}

function big1(){
var ovi=document.getElementById("images1");
ovi.height=ovi.height*1.5
ovi.width=ovi.width*1.5
}


function Get_flashvar(v_upfile,Filetxt){
var obj=document.getElementById(Filetxt);
var ovi=document.getElementById("BIGPIC");
obj.value=v_upfile;
ovi.movie="example.swf?vars=big&uploadfile="+v_upfile;

}


function MM_reloadPage(init) { //reloads the window if Nav4 resized 
if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) { 
document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }} 
else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload(); 
} 
MM_reloadPage(true); 
// -->  
function MM_showHideLayers() { //v3.0 



var i,p,v,obj,args=MM_showHideLayers.arguments; 
for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2]; 
if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; } 
obj.visibility=v; } 
} 

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
function dispaly(n){
var t=document.getElementById(n);
t.style.display="block";
}
function nodispaly(f){
var t=document.getElementById(f);
t.style.display="none";	
	}
	
	
	function DrawImage(ImgD,FitWidth,FitHeight) 
{ 
var image=new Image(); 
image.src=ImgD.src; 
if(image.width>0 && image.height>0) 
{ 
if(image.width/image.height>= FitWidth/FitHeight) 
{ 
if(image.width>FitWidth) 
{ 
ImgD.width=FitWidth; 
ImgD.height=(image.height*FitWidth)/image.width; 
} 
else 
{ 
ImgD.width=image.width; 
ImgD.height=image.height; 
} 
} 
else 
{ 
if(image.height>FitHeight) 
{ 
ImgD.height=FitHeight; 
ImgD.width=(image.width*FitHeight)/image.height; 
} 
else 
{ 
ImgD.width=image.width; 
ImgD.height=image.height; 
} 
} 
} 
} 
var moves;
var initVal;
var alpha;
function show(divobj,Tar){
var div_Tar=document.getElementById(divobj).style;
initVal=parseInt(div_Tar.left);
//alert(initVal+" && "+Tar);

 if(initVal==621){
	alpha=90;
clearInterval(moves);
moves=window.setInterval(function(){move(div_Tar,initVal-100,"in");},10);
	}else if(initVal!=Tar){
	//alert("show")
alpha=10;
clearInterval(moves);
moves=window.setInterval(function(){move(div_Tar,Tar,"out");},10);
}
else{
	//alert("hidden");
alpha=90;
clearInterval(moves);
moves=window.setInterval(function(){move(div_Tar,initVal+100,"in");},10);
}
}

/*
function hide(divobj){
var div_Tar=document.getElementById(divobj).style;
clearInterval(moves);
if(bool=="out" || bool=="null"){
bool="in";
moves=window.setInterval(function(){move(div_Tar,initVal);},10);
}
}
*/
function move(obj,Tar,bool){
var speed=0.05;
var col=0;
//var alpha=100;
if(bool=="out"){
alpha+=2;
if(alpha>=100)alpha=100;
}else{
alpha-=2;
if(alpha<=0)alpha=0;
}
obj.filter="alpha(opacity="+alpha+")";
obj.left=(parseInt(obj.left)+(Tar-parseInt(obj.left)+col)*speed)+"px";
if(Tar==parseInt(obj.left)){
clearInterval(moves);
}
//document.getElementById("view").value=alpha;
}
