/**************************************************/
/*                Html在线编辑器                    */
/**************************************************/
//得到Html编辑器的值
function GetContent()
{
	document.all("content").value=window.frames("editer").frames("Composition").document.body.innerHTML;
	wt = setTimeout("GetContent()",1000)
}
//赋值给Html编辑器的值
function WriteContent()
{
	window.frames("editer").frames("Composition").document.body.innerHTML = document.all("content").value;
}

/**************************************************/
/*                     购物车                      */
/**************************************************/
//增加到购物车
function AddCart(ID)
{
	window.open("Cart/ShowCart.asp?action=Add&ID=" + ID, "MyCart","width=560,height=200,top=20,left=100,scrollbars=1")
}
//查看 购物车
function ViewCart()
{
	window.open("Cart/showCart.asp", "MyCart","width=560,height=200,top=20,left=100,scrollbars=1")
}
//订购
function Order()
{
	window.open("../Order.asp","","");
	window.close()
}
function SubmitAction(theform,action)
{
	//alert (theform)
	theform.action="?action=" + action
}

//查看订单
function ViewOrder(OrderID)
{
	window.open("ViewOrder.asp?OrderID=" + OrderID,"","width=620,height=450,top=20,left=100,scrollbars=1")
}


function Delete()
{
	if(confirm("你确定要删除吗？"))
	{
		return true;
	}	
	else
	{
		return false;
	}
}

function high(which2){
	theobject=which2;
	//theobject.filters.gray.enabled = false;
	theobject.filters.alpha.opacity=0
	highlighting=setInterval("highlightit(theobject)",50)
}

function low(which2){
	clearInterval(highlighting)
	which2.filters.alpha.opacity=60
	//theobject.filters.gray.enabled = true;
}

function highlightit(cur2){
	if (cur2.filters.alpha.opacity<100)
	cur2.filters.alpha.opacity+=30
	else if(window.highting)
	clearInterval(highlighting)
}


var ie = document.all?1:0 
function CA(frm){
var trk=0;
isOnload = 0;

for (var i=0;i<frm.elements.length;i++)
{
var e = frm.elements[i];
if ((e.name != 'allbox') && (e.type=='checkbox'))
{

if (isOnload != 1)
{
trk++;
e.checked = frm.allbox.checked;
if (frm.allbox.checked)
{
	if (e.checked)
	{
		hL(e);
	}
	else
	{
		dL(e);
	}
}
else
{
	if (e.checked)
	{
		hL(e);
	}
	else
	{
		dL(e);
	}
}
}
}
}
}


function CCA(CB){
var frm = CB.form
if (CB.checked)
hL(CB);
else
dL(CB);
var TB=TO=0;
for (var i=0;i<frm.elements.length;i++)
{
var e = frm.elements[i];
if ((e.name != 'allbox') && (e.type=='checkbox'))
{
TB++;
if (e.checked)
TO++;
}
}

if (TO==TB)
frm.allbox.checked=true;
else
frm.allbox.checked=false;
}
function hL(E){
if (ie)
{
while (E.tagName!="TR")
{E=E.parentElement;}
}
else
{
while (E.tagName!="TR")
{E=E.parentNode;}
}
E.className = "H";
}
function dL(E){
if (ie)
{
while (E.tagName!="TR")
{E=E.parentElement;}
}
else
{
while (E.tagName!="TR")
{E=E.parentNode;}
}
E.className = "";
}

//选中列表项
function SelectedItem(listName, value)
{
	objList = document.all(listName)
	if (objList != null)
	{
		len = objList.length;
		if (len != 0 )
		{
		for(i=0;i<len;i++)
		{
			if (objList.options[i].value ==value)
			objList.options[i].selected = true;

		}
	}
	}
}

function openWindow(theURL,winName,features) { //v2.0
  	window.open(theURL,winName,features);
}


function openWindow(theURL,winName,features) { //v2.0
  	window.open(theURL,winName,features);
}

// 查看产品
function ViewImg(ID, theImg){
	window.open('../Product/ViewImg.asp?ImgID='+ ID,'Img','width=450,height=340')
	
}

// 提交询盘
function OpenInquery(ID){
	window.open('../Product/Inquery.asp?id='+ ID,'','width=450,height=340, left=50, top=20')
}

// 头条新闻
function swfPicChange(sizeArray,aimgpath,surl,stitle) {
	var simgpath = "";
	var stitle = "";
	var surl = "";
	for(var i=0;i<aimgpath.length;i++){		
		if(i<(aimgpath.length-1)){					
			simgpath = simgpath + aimgpath[i]+"|";
			stitle = stitle + atitle[i]+"|";
			surl = surl + aurl[i]+"|";
		}else{
			simgpath = simgpath + aimgpath[i];
			stitle = stitle + atitle[i];
			surl = surl + aurl[i];
		}
	}
			
	var focus_width=sizeArray[0];
	var focus_height=sizeArray[1];
	var text_height=sizeArray[2];
	var swf_height = focus_height+text_height;
	var swf_file = "/flash/preview.swf";
	var str = '<object ID="focus_flash" 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 +'">';
	str += '<param name="allowScriptAccess" value="sameDomain"><param name="movie" value="'+swf_file+'"><param name="quality" value="high"><param name="bgcolor" value="#E7E7E7">';
	str += '<param name="menu" value="false"><param name=wmode value="opaque">';
	str += '<param name="FlashVars" value="pics='+simgpath+'&links='+surl+'&texts='+stitle+'&borderwidth='+focus_width+'&borderheight='+focus_height+'&textheight='+text_height+'">';
	str += '<embed ID="focus_flash" src="'+swf_file+'" wmode="opaque" FlashVars="pics='+simgpath+'&links='+surl+'&texts='+stitle+'&borderwidth='+focus_width+'&borderheight='+focus_height+'&textheight='+text_height+'" menu="false" bgcolor="#E7E7E7" quality="high" width="'+ focus_width +'" height="'+ focus_height +'" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"/>';
	str += '</object>';
	document.writeln(str);
}

function menuFix() {
 var sfEls = document.getElementById("menu").getElementsByTagName("li");
 for (var i=0; i<sfEls.length; i++) {
  sfEls[i].onmouseover=function() {
  this.className+=(this.className.length>0? " ": "") + "sfhover";
  }
  sfEls[i].onMouseDown=function() {
  this.className+=(this.className.length>0? " ": "") + "sfhover";
  }
  sfEls[i].onMouseUp=function() {
  this.className+=(this.className.length>0? " ": "") + "sfhover";
  }
  sfEls[i].onmouseout=function() {
  this.className=this.className.replace(new RegExp("( ?|^)sfhover\\b"), 

"");
  }
 }
}
window.onload=menuFix;


