﻿//图片处理
<!--
function imgadapter(obj,width,height)
{
var max_height = height;
var max_width = width;
var real_height = obj.height;
var real_width = obj.width;
if(obj.height>max_height)
{
obj.height = max_height;
obj.width = Math.round(obj.height*real_width/real_height);
}
if(obj.width>max_width)
{
obj.width = max_width;
obj.height = Math.round(obj.width*real_height/real_width);
}
}
// --> 
//禁止右键
<!--
var message="";
///////////////////////////////////
function clickIE() {if (document.all) {(message);return false;}}
function clickNS(e) {if 
(document.layers||(document.getElementById&&!document.all)) {
if (e.which==2||e.which==3) {(message);return false;}}}
if (document.layers) 
{document.captureEvents(Event.MOUSEDOWN);document.onmousedown=clickNS;}
else{document.onmouseup=clickNS;document.oncontextmenu=clickIE;}
document.oncontextmenu=new Function("return false")
// --> 
//禁止查看源文件
function clear(){ 
Source=document.body.firstChild.data;
document.open();
document.close();
document.body.innerHTML=Source;
}

//菜单分类
	function opencat(cat,img)
	{
 	 	if(cat.style.display=="none"){
     	cat.style.display="";
    	 img.src="/upfiles/system/minus.gif";
  		} else {
     	cat.style.display="none"; 
     	img.src="/upfiles/system/plus.gif";
  		}
	}

//移动产品导航
<!--
function getNames(obj,name,tij)
{ 
   var p = document.getElementById(obj);
   var plist = p.getElementsByTagName(tij);
   var rlist = new Array();
   for(i=0;i<plist.length;i++)
   {
    if(plist[i].getAttribute("name") == name)
    {
     rlist[rlist.length] = plist[i];
    }
   }
   return rlist;
}

   function butong_net(obj,name)
   {
    var p = obj.parentNode.getElementsByTagName("td");
    var p1 = getNames(name,"kuan","div");
    for(i=0;i<p1.length;i++)
    {
     if(obj==p[i])
     {
      p[i].className = "s";
      p1[i].className = "shangmian";
     }
     else
     {
      p[i].className = "";
      p1[i].className = "dibu";
     }
    }
   }
// --> 
//字体大小
function doZoom(size){
	document.getElementById('zoom').style.fontSize=size+'pt'
}
// -->
//验证表单——验证为email格式
function isEmail(strEmail) {
if (strEmail.search(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/) != -1)
return true;
else
alert("Please enter a valid email address!");
}

<!-- 
function killErrors() {
return true;
}
window.onerror = killErrors;


//ajax提示框========================================
function openWithIframe(tit,url,w,h){
	var sWidth,sHeight;
	sWidth=document.body.clientWidth;
	sHeight=document.body.scrollHeight;
	if(sHeight<window.screen.height){sHeight=window.screen.height;}
	var bgObj=document.createElement("div");
	bgObj.setAttribute('id','bgDiv');
	bgObj.style.position="absolute";
	bgObj.style.top="0";
	bgObj.style.background="#000000";
	bgObj.style.filter="Alpha(Opacity=30);";
	bgObj.style.left="0";
	bgObj.style.width=sWidth + "px";
	bgObj.style.height=sHeight + "px";
	bgObj.style.zIndex = "10000";
    document.body.appendChild(bgObj);

    massage_box.style.left = (document.body.clientWidth - w) / 2;
    massage_box.style.top = (screen.height - h) / 2+200;
    massage_box.style.screenx = (document.body.clientWidth - w) / 2;//仅适用于Netscape
    massage_box.style.screeny = (screen.height - h) / 2-80;//仅适用于Netscape
    massage_box.style.width = w+"px";
    massage_box.style.height = h+"px";
    pop_title.innerHTML=tit;
    massage_box.style.display=''
    var popiframe='<iframe src="'+url+'" width="'+(w-11)+'px"  height="'+(h-36)+'px" frameborder=0 scrolling=no></iframe>';
    pop_iframe.innerHTML=popiframe;
}
function closeWithIframe(){
    massage_box.style.display="none";
    document.body.removeChild(document.getElementById("bgDiv"));
}
document.write('<div id="massage_box" style="position:absolute; FILTER: progid:DXImageTransform.Microsoft.DropShadow();z-index:10001;display:none">');
document.write('<div style="border-width:1 1 3 1; width:100%; height:100%; background:#fff; color:#666666; font-size:12px; line-height:150%">');
document.write('<div onClick="closeWithIframe()" onmousedown=MDown(massage_box) style="background:#666666; height:20px; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:12px;color:#fff;cursor:move;padding:0 0 4px 0">');
document.write('<div style="display:inline; width:200px; position:absolute;padding:3px 0 0 5px" id=pop_title></div>');
document.write('<span  style="float:right; display:inline; cursor:pointer;padding:3px 5px 0 0;font-size:12px">CLOSE</span>');
document.write('</div>');
document.write('<div style="padding:5px" id=pop_iframe></div>');
document.write('</div>');
document.write('</div>');
//ajax提示框功能========================================

