﻿//// JavaScript Document
//function DrawImage(ImgD,PicWidth,PicHeight){ 
// var image=new Image(); 
// image.src=ImgD.src; 
// if(image.width>0 && image.height>0){ 
//  if(image.width/image.height>= PicWidth/PicHeight){ 
//   if(image.width>PicWidth){
//    ImgD.width=PicWidth; 
//    ImgD.height=(image.height*PicWidth)/image.width; 
//   }else{ 
//    ImgD.width=image.width;
//    ImgD.height=image.height; 
//   } 
//   ImgD.alt=""; 
//  } 
//  else{ 
//   if(image.height>PicHeight){
//    ImgD.height=PicHeight; 
//    ImgD.width=(image.width*PicHeight)/image.height; 
//   }else{ 
//    ImgD.width=image.width;
//    ImgD.height=image.height; 
//   } 
//   ImgD.alt=""; 
//  } 
// }
//}
////
//function iconHandler(){
//    var obj=new Array;
//    var status = $getObj("hidLayOutTag").value;
//    switch (status){
//        case "1":
//            var col=cleanWhitespaces($getObj("page1"));
//            for (var c=0;c<col.length;c++){
//                var temp_obj=cleanWhitespaces(col[c]);
//                for(var t=0;t<temp_obj.length;t++){
//                    obj.push(temp_obj[t]);
//                }
//            }
//            
//        break;
//        case "2":
//            obj=cleanWhitespaces($getObj("father"));
//        break
//    }
//    //console.log(obj);
//    for(var i=0;i<obj.length;i++){
// 
//        obj[i].onmouseover=function(){
//            var _obj=this.id+"_icon";
//            if ($getObj(_obj)!=undefined)
//                $getObj(_obj).style.display="inline-block";
//        };
//        obj[i].onmouseout=function(){
//            var _obj=this.id+"_icon";
//            if ($getObj(_obj)!=undefined)
//                $getObj(_obj).style.display="none";
//        }
//    }
//}


///*首页搜索模块排版*/
//function sAll(){
//    if ($getObj("sdlBox")){
//        var sw = $getObj("sdlBox").clientWidth;
//        //alert(sw)
//        if(sw!=0){
//            var inputw = parseInt(sw)-125;
//            $getObj("txtKey").style.width=inputw+"px";
//        }
//	}
//}


//function getLogoStat(){
//	var obj = $getObj("logoimg");
//	var fobj = obj.parentNode;
////	var stopArr = "{\"logo\":[" + 
////	              obj.style.width + "," +
////				  obj.style.height + "," +
////				  obj.style.left + "," +
////				  obj.style.top + "," +
////				  fobj.style.height +"]}";
//	var stopArr = obj.style.width + "," +
//				  obj.style.height + "," +
//				  obj.style.left + "," +
//				  obj.style.top + "," +
//				  fobj.style.height;
//	//alert(cleanPX(stopArr));
//	$getObj("LogoStatus").value=cleanPX(stopArr);
//}
//var logoStatus=function(obj,top){
////	var Width=$getObj(obj).style.width;
//	var Height=$getObj(obj).style.height;
////    var img;
////        if(document.getElementById("logoobj").nodeName.toLowerCase() == "img"){
////            img=document.getElementById("logoobj");
////        }else{
////            if(isIE){
////                img=document.getElementById("logoobj");
////            }else{
////                img=document.getElementById("logoemb");
////            }
////        }
////	    img.style.width=Width;
////	    img.style.height=Height;
//	    
//	if(!top && top!="fix"){
//	
//	    var father=$getObj("logo");
//        var minH = parseInt(CurrentStyle($getObj("logo")).minHeight);
//        var nowH = parseInt($getObj("logoimg").style.top) + parseInt(Height);
//	    father.style.height=  Math.max(minH,nowH) + "px";
//    }
//}

//function logoCustom(){
//        var maxR = parseInt(CurrentStyle($getObj("Container")).width) || $getObj("Container").offsetWidth;
//		var rs = new Resize("logoimg",{
//									  			Max:		true,
//												//mxContainer:"father",
//												mxRight:	maxR,
//							                    onResize:	function(){
//							                                    if($getObj("Checkbox1").checked){
//											                        logoStatus("logoimg","fix");
//							                                    }else{
//                                                                    logoStatus("logoimg");
//							                                    }
//										                    }
////										        ,
////									  			onStop:		function(){
////																getLogoStat();
////															}
//									  		});
//		rs.Set("reHand", "right-down");
//		//拖动	
//		new xDrag("logoimg",{
//						   		Limit: true,
//								mxContainer: "Header", 
//								Handle:     "logoHand",
//								Width: 		parseInt($getObj('logoimg').style.width),
//								Height: 	parseInt($getObj('logoimg').style.height), 
//								marginLeft: parseInt($getObj('logoimg').style.left),
//								marginTop:	parseInt($getObj('logoimg').style.top), 
//								zIndex: 	0,
//								onMove:     function(){
//			                                    if(!$getObj("Checkbox1").checked){
//			                                        var minH = parseInt(CurrentStyle($getObj("logo")).minHeight);
//			                                        var nowH = parseInt($getObj("logoimg").style.top) + parseInt($getObj("logoimg").style.height);
//			                                        $getObj("logo").style.height = Math.max(minH,nowH) + "px";
//			                                    }
//								            }
////								,
////					  			onStop:		function(){
////												getLogoStat();
////											}
//								});
//};



////单页图文图片大小控制
//function maxImg(){ 
//	var Pic = document.getElementById("s_img");
//	var dt = Pic.parentNode.parentNode;
//	var dd = dt.nextSibling;
//	
//	        
//    if (Pic.width > 500)
//	{
//		Pic.width = 500 ;
//	}
//    if (Pic.width > 400)
//    {
//        if (document.all){
//        dt.style.styleFloat   = "none";
//        }else{
//        dt.style.cssFloat  = "none";
//        }
//        dt.style.marginLeft = "auto";
//        dt.style.marginRight = "auto";
//	}else{
//    
//    }

//        dt.style.width = Pic.width + "px";
//        dt.style.height = Pic.height + "px";
//}


