function high(which2){
   theobject=which2;theobject.filters.alpha.opacity=50
   highlighting=setInterval("highlightit(theobject)",1)
   }
   
function low(which2){
    clearInterval(highlighting)
    which2.filters.alpha.opacity=50
   }

function highlightit(cur2){
   if (cur2.filters.alpha.opacity<100)
       cur2.filters.alpha.opacity+=3
   else if(window.highting)
   clearInterval(highlighting)
}


//缩略图
function imgzoom(img,maxsize){
	var a=new Image();
	a.src=img.src
	if(a.width > maxsize * 4)
	{
		img.style.width=maxsize;
	}
	else if(a.width >= maxsize)
	{
		img.style.width=Math.round(a.width * Math.floor(4 * maxsize / a.width) / 4);
	}
	return false;
}



function setCookie(name, value)		//cookies设置
{
	var argv = setCookie.arguments;
	var argc = setCookie.arguments.length;
	var expires = (argc > 2) ? argv[2] : null;
	if(expires!=null){
		var LargeExpDate = new Date ();
		LargeExpDate.setTime(LargeExpDate.getTime() + (expires*1000*3600*24));
	}
	document.cookie = name + "=" + escape (value) + "; path=/;" +((expires == null) ? "" : (" expires=" +LargeExpDate.toGMTString()));
}

function getCookie(Name)			//cookies读取
{
	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));
		}
	}
	return "";
}
// 内容样式用户定义
// 改变字号
function ContentSize(size)
{
	var obj=document.getElementById("info_content");
	obj.style.fontSize=size>0 ? size+"px" : "";
	if (arguments.length==1){
		setCookie("ylFontSize",size,size==0?-1:1);
	}
}
// 改变背景色
function ContentBg(color)
{
	var obj=document.getElementById("info_Main");
	obj.style.backgroundColor=color;
	if (arguments.length==1){
		setCookie("ylContBg",color,color.length==0?-1:1);
	}
}
// 内容样式存入getCookie
function InitContStyle()
{
	var v=getCookie("ylFontSize");
	if (v.length>0){
		ContentSize(v,false);
	}
	v=getCookie("ylContBg");
	if (v.length>0){
		ContentBg(v,false);
	}
}




//FLASHJS通用类
function images_flashobj(object_id, embed_name, url, bgcolor, wmode, width, height)
//应用：flash("menu", "menu", "http://www.115000.com.cn/liuy/Downloads/网页配色器.swf", "", 0, "100%", "100%");

//flash("menu", "menu", "flash/pic_01.swf?bcastr_xml_url=flash_xml_01.xml", "", 0, "313", "120");
//flash("menu", "menu", "flash/pic_02.swf?varsPic=flash_xml_02.xml", "", 0, "193", "100");
//flash("menu", "menu", "flash/pic_03.swf?varsUrl=flash_xml_03.xml", "", 0, "337", "276");
//flash("menu", "menu", "flash/pic_05.swf?varsUrl=flash_xml_05.xml", "", 0, "337", "276");

	{
		document.write ('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="' + width + '" height="' + height + '" id="' + object_id + '" align="middle">');
		document.write ('<param name="allowScriptAccess" value="sameDomain">');
		document.write ('<param name="movie" value="' + url + '">');
		document.write ('<param name="quality" value="high">');
		if (wmode == 1 || wmode == "1")
		{
		document.write ('<param name="wmode" value="transparent">');
		}
		document.write ('<param name="bgcolor" value="' + bgcolor + '">');
		document.write ('<embed src="' + url + '" width="' + width + '" height="' + height + '" name="' + embed_name + '" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer">');
		document.write ('</embed>');
		document.write ('</object>');
	}



//////////////////////////////////////////////预览代码
function runCode(obj) {
 var winname = window.open('', "_blank", '');
 winname.document.open('text/html', 'replace');
 winname.document.writeln(obj.value);
 winname.document.close();
}
function copyCode(obj) {
 var rng = document.body.createTextRange();
 rng.moveToElementText(obj);
 rng.scrollIntoView();
 rng.select();
 rng.execCommand("Copy");
 rng.collapse(false);
}

function saveCode(obj) {
 var winname = window.open('', '_blank', 'top=10000');
 winname.document.open('text/html', 'replace');
 winname.document.writeln(obj.value);
 winname.document.execCommand('saveas','','code.htm');
 winname.close();
}




//表单验证
function fucCheckLength(strTemp)
{
	var i,sum;
	sum=0;
	for(i=0;i<strTemp.length;i++)
	{
		if ((strTemp.charCodeAt(i)>=0) && (strTemp.charCodeAt(i)<=255))
			sum=sum+1;
		else
			sum=sum+2;
	}
	return sum;
}
function chkemail(a)
{	var i=a.length;
	var temp = a.indexOf('@');
	var tempd = a.indexOf('.');
	if (temp > 1) {
		if ((i-temp) > 3){
			
				if ((i-tempd)>0){
					return 1;
				}
		}
	}
	return 0;
}
function fucCheckTEL(TEL)
{
	var i,j,strTemp;
	strTemp="0123456789-()# ";
	for (i=0;i<TEL.length;i++)
	{
		j=strTemp.indexOf(TEL.charAt(i));	
		if (j==-1)
		{
		//说明有字符不合法
			return 0;
		}
	}
	//说明合法
	return 1;
}
function fucCheckNUM(NUM)
{
	var i,j,strTemp;
	strTemp="0123456789.";
	if ( NUM.length== 0)
		return 0
	for (i=0;i<NUM.length;i++)
	{
		j=strTemp.indexOf(NUM.charAt(i));	
		if (j==-1)
		{
		//说明有字符不是数字
			return 0;
		}
	}
	//说明是数字
	return 1;
}

//========================================简介字数显示
function textCounter(field, maxlimit) { 
	if (field.value.length > maxlimit){ 
        field.value = field.value.substring(0, maxlimit); 
	}else{
	       myform.remLen.value = maxlimit - field.value.length;
	      }
}
