﻿function submitsearch()
{
	var searchkeywords = document.all["keywords"].value;
	if(searchkeywords=="")
	{
		alert("请输入搜索的关键字");
		return false;
	}
	//location.href="dosearch.aspx?ClassID="+prClassID+"&keywords="+searchkeywords;
}

function selectAll(ObjName)
{//全选	
	var chkProductID = document.all[ObjName];
	if(chkProductID==null) return;
	var len = chkProductID.length;
	var i;
	if(len!=null)
	{
        for (i=0;i<len;i++)
        {
			chkProductID[i].checked=true;
	    }
	}
	else
	{
	    chkProductID.checked=true;
	}
}

function unSelectAll(ObjName)
{//取消选择
	var chkProductID = document.all[ObjName];
	if(chkProductID==null) return;
	var len = chkProductID.length;
	var i;
	if(len!=null)
	{
        for (i=0;i<len;i++)
        {
		    chkProductID[i].checked=false;
	    }
	}
	else
	{
	    chkProductID.checked=false;
	}
}

function DrawImage(ImgD,ImgWidth,ImgHeight)
{
	var flag=false;
	var image=new Image();
	image.src=ImgD.src;
	if(image.width>0 && image.height>0 && ImgWidth>0 && ImgHeight>0)
	{
		flag=true;
		if(image.width/image.height>= ImgWidth/ImgHeight)
		{
			if(image.width>ImgWidth)
			{ 
				ImgD.width=ImgWidth;
				ImgD.height=(image.height*ImgWidth)/image.width;
			}
			else
			{
				ImgD.width=image.width; 
				ImgD.height=image.height;
			}
		}
		else
		{
			if(image.height>ImgHeight)
			{ 
				ImgD.height=ImgHeight;
				ImgD.width=(image.width*ImgHeight)/image.height; 
			}
			else
			{
				ImgD.width=image.width; 
				ImgD.height=image.height;
			}
		}
	}
} 

function copyToClipBoard(){
	var clipBoardContent=document.location;
	words=' 我在 广州爬山虎户外用品专卖网 pashanhu.cn 看到这则信息:[ {WebTitle} ] 可能对你有用处!你自己看看，网址是:';
	words+=clipBoardContent;
	window.clipboardData.setData("Text",words);
	alert("复制成功！你可以粘贴在QQ消息里告诉你的好朋友！再次感谢你对[广州爬山虎户外用品专卖网]的支持！");
}

function addcart(frmObj,type){	
	frmObj.pr_type.value = type;
}

//=====改变样式并利ajax返回结果==========
//idstr---当前ID
//idHeader---按钮ID的头部
//count---按钮的数量
//divID---显示信息的图层ID
//class1---样式1
//class2---样式2
//url---信息的文件地址
//====================================
function showInfo(idstr,idHeader,count,divID,class1,class2,url)
{
	for(i=1;i<=count;i++)
	{
		document.getElementById(idHeader+i).className=class1;
	}
	document.getElementById(idstr).className=class2;
	if(url!="")
	{
		getInfo(url,divID);
	}
}

//=======跳转网址======
//url---跳转的网址
//====================
function locationUrl(url)
{
	location.href=url;
}