function MyPrint(){
	var $form = document.forms['PrintForm'];
	$form.PrintContent.value=document.getElementById("PrintData").innerHTML;
	$form.submit();
}

function PopForm(act) {
	var popcheck=window.open('','popcheck','width=400,height=400,resizable=1');
	popcheck.document.writeln("<font face='Verdana, Arial, Verdana' size='2' color='#666666'>"
		+"<br /><br />loading...</font>"); //When you click submit this text will be display in the new window.
	document.forms['form1'].target="popcheck";
	document.forms['form1'].method="post";
	popcheck.moveTo(screen.width/2-203,screen.height/2-130);
	document.forms['form1'].action=act;
	document.forms['form1'].submit();
}

function CheckAll(form) {
	for (var i=0;i<form.elements.length;i++) {
		var e = form.elements[i];
		if(e.name != 'chkall')e.checked = form.chkall.checked; 
	}
}

function del(src){
	if(confirm("你确认要删除吗? 删除之后将不能再恢复!")) window.location=src;
}

function del2(src){
	if(confirm("你确认要删除吗? 删除之后将不能再恢复!")) newwin(src);
}

function opencat(cat_id,img){
	cat = document.getElementById(cat_id);
	if(cat.style.display=="none"){
		cat.style.display="";
		img.src="images/noplus.gif";
	} else {
		cat.style.display="none"; 
		img.src="images/plus.gif";
	}
}

function opencat2(cat,img){
	if(cat.style.display=="none"){
		cat.style.display="";
		img.value="关闭编辑";
	} else {
		cat.style.display="none"; 
		img.value="打开编辑";
	}
}

function newwin(url,name){
	window.open(url,name, "width=400,height=400,resizable=1,scrollbars=0");
}

function winsize(url,name,w,h){
	window.open(url,name, "width="+w+",height="+h+",resizable=1,scrollbars=0");
}

function go(src,msg){
	var ret;
	ret = confirm(msg);
	if(ret!=false) window.location=src;
}

function s(){ 
	if(switchPoint.innerText==3){
		switchPoint.innerText=4;
		document.all("frmTitle").style.display="none";
	} 
}

function trim ($str) {
	return $str.replace(/^\s\s*/, '').replace(/\s\s*$/, '');
}

function jResize(ImgD){
	if(!$.browser.msie)return;
	var size = 160;
	//var width=$($img).width;var height=$($img).height;
	//if(width>200) $($img).height(parseInt(height*200/width)).width(200);
	var image=new Image();
	image.src=ImgD.src;
	if(image.width>0 && image.height>0){ 
		flag=true;
		if(image.width >= image.height){ 
			if(image.width>size){
				ImgD.style.width=size+"px";
				ImgD.style.height=parseInt((image.height*size)/image.width)+"px";
			}else{ 
				ImgD.style.width=image.width+"px";
				ImgD.style.height=image.height+"px";
			} 
			ImgD.alt="Click for details...";
		}  else{ 
			if(image.height>size){
				ImgD.style.height=size+"px";
				ImgD.style.width=parseInt((image.width*size)/image.height) + "px";
			}else{ 
				ImgD.style.width=image.width+"px";
				ImgD.style.height=image.height+"px";
			}
		}
	}
}

$(document).ready(function(){
	$(".marquee").marquee({direction: "left", step: 1, pause: 0 }); 
	$('.leftcontent1 div.rotate').vTicker({
		speed: 500,
		pause: 3000,
		showItems: 10,
		animation: 'fade',
		mousePause: true,
		height: 0,
		direction: 'up'
	});
	$("div#goods_list ul li").hover(function(){$(this).css({"border-color":"#999"});}, 
		function(){$(this).css({"border-color":"#ddd"});}
	);
	$("table#news_list tr").hover(function(){$(this).css({"background-color":"#f6f6f6"});}, 
		function(){$(this).css({"background":"none"});}
	);
});
