var userloginweb='http://u.haogouwu.com';//会员平台URL；
document.write('<form id="haogouwut" name="haogouwut" method="POST" target="_blank" style="display:none;width:0;height:0;overflow:hidden;"><input type="hidden" id="haogouwut_url" name="url"></input></form>');
function taolianxi(str) {
	document.getElementById("haogouwut").action="http://amos1.taobao.com/msg.ww?v=2&uid="+str+"&site=cntaobao&s=1"; 
	document.getElementById("haogouwut").submit();
	//window.open("http://amos.im.alisoft.com/msg.aw?v=2&uid="+str+"&site=cntaobao&s=2&charset=utf-8");
}

function taogoods(str){
	document.getElementById("haogouwut").action='http://'+window.location.host+'/viewurl.php?aid='+str; 
	document.getElementById("haogouwut").submit();
}
function turl(str){
	document.getElementById("haogouwut").action='http://s.click.taobao.com/'+str+'  '; 
	document.getElementById("haogouwut").submit();
}
function to_d1_com_cn(str){
	document.getElementById("haogouwut").action='http://click.linktech.cn/?m=d1bianli&a=A100104079&l=99999&l_cd1=0&l_cd2=1&u_id='+user_id+'&tu=http%3A%2F%2Fwww.d1.com.cn%2Fsales%2Fsalesviews.asp%3Fid%3D'+str; 
document.getElementById("haogouwut").submit();
}
function to_linktech(u,str){
	document.getElementById("haogouwut").action='http://click.linktech.cn/?m='+u+'&a=A100104079&l=99999&l_cd1=0&l_cd2=1&u_id='+user_id+'&tu='+str; 
document.getElementById("haogouwut").submit();
}
function to_tmall(str){
	if(confirm("该活动为淘宝网店铺推广，不能直接返钱到您的账户上！\n您购买确认收货后，需使用“找回订单”功能认领才能返钱到您的账户上。\n\n钱“确定”直接进入商城参加打折活动，钱“取消”查看如何使用“找回订单”功能认领返钱。"))
{document.getElementById("haogouwut").action='http://s.click.taobao.com/t_9?p=mm_15245242_0_0&l=http%3A%2F%2F'+str; 
document.getElementById("haogouwut").submit();}else{window.open("http://u.haogouwu.com/read.php?id=1&p");}
}
document.write('<form name="haoshop" method="POST" target="_blank" style="display:none;width:0;height:0;overflow:hidden;"></form>');
function haoshop(str,jfid){
	window.open('http://'+window.location.host+'/tbshop.php?aid='+str+'&jfid='+jfid);
	//document.getElementById("haoshop").action='http://'+window.location.host+'/tbshop.php?aid='+str+'&jfid='+jfid; document.haoshop.submit();
}
document.write('<link href="/img/userin.css" rel="stylesheet" type="text/css" />');

document.write('<form name="tourl" id="tourl" method="POST" target="_blank" style="display:none;width:0;height:0;overflow:hidden;"><input type="hidden" id="tourl_url" name="url"></input></form>');
function ol8(gourl){
//window.open('http://'.gourl);
document.getElementById("tourl").action='/go.php';
document.getElementById("tourl_url").value=gourl; 
 document.getElementById("tourl").submit();
}
var srcc = window.location;var ss;srcc = srcc.toString();start = srcc.indexOf("#");end = srcc.length;ss=srcc.substring(start+1,end);
var userid_tj;var user_id;
var notx;var haousername;
thisurl=srcc.substring(0,start);if(thisurl=='')thisurl=window.location;
s = ss.substr(1);
if(ss.indexOf("&")!=-1){
	document.write('<style>.uinfo,.uinfo2{display:none;}</style>');
	var refstr='<script type="text/javascript" src="'+userloginweb+'/users.php?rec='+s+'"  charset="UTF-8"><\/script><script type="text/javascript" src="/goodcookie.php?tjr='+s+'" charset="UTF-8"><\/script>';
	}else{
		var userid_tj=user_id_init;
		if(user_id>=1){
		refstr='<div class="L">好消息：介绍用户到本站注册，您将永久获得该会员购物奖金的<font color="#FF0000">12%</font>做为奖励！您的当前下线推广地址：<br><a href="http://www.jiathis.com/share/?uid=1510661" class="jiathis" target="_blank"><img src="http://v1.jiathis.com/code/images/jiathis2.gif" border="0" /></a>分享时，请把网址换成您的推广链接^_^。（详情请见<a href="http://u.haogouwu.com/read.php?id=17" target="_blank">推广计划</a>）</div><div class="L"><input style="width:280px" id="TDsearch" type="text" class="kw" value="'+thisurl+'#&'+userid_tj+'"><input type="submit" value="复制" onclick="copytxts(\'TDsearch\')"></div>';}else{refstr='<a href="http://www.jiathis.com/share/?uid=1510661" class="jiathis" target="_blank"><img src="http://v1.jiathis.com/code/images/jiathis2.gif" border="0" /></a>您好，您还未<a href="http://u.haogouwu.com/user/login.php">登陆</a>我们网站，登陆后您购物时可以得到奖金！并且可以推广下线会员获取下线高额的提成！ 点<a href="http://u.haogouwu.com/user/login.php">这里登陆</a>';}
		if(ss.indexOf("?")!=-1 && srcc.indexOf("#")!=-1){
	document.write('<style>.shengqian{display:none;}</style><script type="text/javascript" src="/goodcookie.php?notx=8&tjr='+s+'" charset="UTF-8"><\/script>');
	}
	}
//if(user_id_init>1)refstr='计费ID：'+user_id_init+refstr;

document.write('<style>#jump_tit{height:30px;overflow:hidden;}#layer_goods{width:228px;}</style><div class="jumpbox" id="jumpbox"> <div class="top_left"></div> <div class="top_center"></div> <div class="top_right"></div> <div class="middle_left"></div> <div class="middle_center"> <div class="close"><a href="javascript:;" id="jumpclose"></a></div> <div class="contain"><div class="nots">您尚未登录，请按如下方式获得返钱！</div><div class="lef"> <div class="pic"><img src="" id="jump_pic" width="160"/><br /> </div></div><div class="rig"><div id="jump_tit"></div> <div class="fan"></div> <div class="detail" id="layer_goods" style="display:none">原价：<span class="jump_price">--.--</span>元<br />可返钱：<span id="jump_back">--.--</span>金钱<br>可换成<span id="jump_back_m">--.--</span>元现金<br /></div> <div class="detail" id="layer_zg" style=" display:none">平均可返钱：<span class="jump_price">--.--</span><br /></div> <div class="detail" id="layer_mall" style=" display:none">最高返：<span class="jump_price">--.--</span><br /></div></div> <div class="clear"></div> </div><div class="help" style="height:26px;"> <span><a href="" id="jump_href" target="_blank">不要返钱，去看看>></a> </span> <a href="'+userloginweb+'/user/register.php" target="_blank">没有账号？那就先注册吧</a></div> <div class="login"><strong>如果您已经是网站会员？</strong>——请输入您的用户名和密码，会返钱到该账户!<br /> <div> <table border="0" cellpadding="0"><form id="form1" name="form1" method="post" action="'+userloginweb+'/user/checklogin.php"> <tr> <th scope="col">账号：<input name="username" id="loginuser" type="text" class="text"/></th> <th scope="col">密码：<input name="password" id="loginpwd" type="password" class="text"/></th> <th scope="col"><input type="hidden" name="from" value="" id="from" /><input type="submit" value="快速返钱" class="smt" name="submits" onclick="checkLogin(1)" /></th> </tr></form> </table> </div> <span id="jump_logtips"></span> </div> </div> <div class="middle_right"></div> <div class="end_left"></div> <div class="end_center"></div> <div class="end_right"> </div></div>');


$.ajaxSetup ({
    cache: false //关闭AJAX相应的缓存
});
if(haousername!='' || notx>1){;}else{
$(function(){
    $('.checkLogin').click(function(){
		url=$(this).attr('href');
		index=$(this).attr('index');
		//var img=$('#sp ul li').eq(index).children('.pic').attr('img');
		var img=$('.spg li').eq(index).children('a').attr('pic');
		var price=$('.spg li').eq(index).find('.tkprice').find('em').html();
		var fx=$('.spg li').eq(index).find('.tkprice').find('b').html();
		var tit=$('.spg li').eq(index).find('.tt').text();
		var gid=$('.spg li').eq(index).children('a').attr('alt');
		$('#layer_goods').show();
		$('#jump_tit').html(tit);
		$('#jump_pic').attr('src',img);
		//$('#jump_href').attr('href',url);
		$('#jump_href').attr('href','http://'+window.location.host+'/viewurl.php?aid='+gid+'&tit='+tit);
		$('.jump_price').text(price);
		$('#jump_back').text(fx);
		var fx2=fx/200;//返钱1元相当于200钱
		$('#jump_back_m').text(fx2);
		$('#from').attr('value','http://'+window.location.host+'/viewurl.php?aid='+gid+'&tit='+tit);
	    if(haousername!=''){
			window.open(url);
		}
		else{
		    $('.jumpbox').show();
		}
	return false;
	});
	
	$('#jumpclose').click(function(){
	    $('.jumpbox').hide();
	});
});
}
function ChangeCss(n)
{ 
	document.getElementById("splistbox").className="splistbox"+n;
}


function setPic(pic,width,height,alt){
	
	pic =  decode64(pic);
	
	writestr = "<img src='"+pic+"' ";
	if(width!=0){
		writestr+=" width="+width;
	}
	if(height!=0){
		writestr+=" height="+height;
	}
	writestr = writestr+" alt='"+alt+"' />";
	
	document.write(writestr);
}

function getpic(thispic,pic){
	
	pic =  decode64(pic);
	thispic.src = pic;
}
function tihuan()
{
	str = decode64(str);
	document.getElementById("tb_content").innerHTML = str;

}
function clickurl(urlid){
	urlid =  decode64(urlid);
	window.open(urlid);
	//location.href=urlid;
	
}

function checkLogin(session){//session为1记录登陆状态
    var ddusername=$('#loginuser').val();
	var dduserpwd=$('#loginpwd').val();
	var jump_href=$('#jump_href').attr('href');
	if(ddusername=='' || dduserpwd==''){
	    alert('用户名或密码不能为空');
	}
	else{
	    $.post('ajax.php?fun=checkLogin', {'ddusername':ddusername,'dduserpwd':dduserpwd,'session':session}, function(data){
		    if(data>0){
				//$('.jumpbox').hide();
				//location.replace(location.href);
			    window.location.href=jump_href;
		    }
			else{
			    alert('账号密码错误');
			}
	    });
	}
}

function parse_url(url){
 var pattern = /(\w+)=(\w+)/ig;
 var parames = {};
 url.replace(pattern, function(a, b, c){
  parames[b] = c;
 });
 return parames;
}

function AddFavorite(sURL, sTitle){
 try{
  window.external.addFavorite(sURL, sTitle);
  }
 catch (e){
  try{
   window.sidebar.addPanel(sTitle, sURL, "");
   }
  catch (e)
  {
   alert("加入收藏失败，您的浏览器不允许，请使用Ctrl+D进行添加");
  }
 }
}

function selthis()
{
	$('.s-nav a').click(function(){
		$('.s-nav a').removeClass().addClass('n');
		$(this).removeClass().addClass('y');
		$('#s-txt').val($(this).attr('value'));
		$('#s-txt').attr('name',$(this).attr('name'));
		$('.box_form').attr('action',$(this).attr('s'));
	});
}
function showl(targetid,objN){//
var target=document.getElementById(targetid);
 var aa=document.getElementById(objN);
if (target.style.display=="block"){ target.style.display="none";aa.innerText=">>显示更多<<";} else { target.style.display="block";aa.innerText='>>隐藏更多<<';
}
}
function iframes(url,file,width,height){
document.write('<iframe src="http://'+url+file+'" width="'+width+'" height="'+height+'" marginwidth="0" marginheight="0" hspace="0" vspace="0" frameborder="0" scrolling="no"></iframe>');
}

function o8(str){
window.open("http://"+str);
}
function copytxts(id,notice){
	var notice="\n\n"+notice;
   var obj = document.getElementById(id);
   obj.select();
   js = obj.createTextRange();
   js.execCommand("Copy");
   alert("复制成功!"+notice);
}

function ntab2_register(id, def) { var obj = document.getElementById(id);  var head = null;  var body = null;  for (var i = 0; i < obj.childNodes.length; i++)  {   var node = obj.childNodes[i];   if (node.tagName == 'DIV')   {    if (node.className == 'nhead') head = node;    else if (node.className == 'nbody') body = node;   }  }  var items = head.getElementsByTagName('LI');  var datas = body.getElementsByTagName('DL');  var total = items.length;  if (typeof def == 'undefined') def = 0;  else def = parseInt(def)%total;  if (def < 0) def += total;   for (var i = 0; i < total; i++)  {   datas[i].style.display = (i == def ? '' : 'none');   items[i].className = (i == def ? 'current' : '');   items[i].onclick = function() { for (var k = 0; k < total; k++)    { datas[k].style.display = (this == items[k] ? '' : 'none'); items[k].className = (this == items[k] ? 'current' : '');    }   }  } }

var nav_user = document.getElementById("nav_user").childNodes;
for (var i=0;i<nav_user.length;i++)
{
 if (nav_user[i].className=="menu")
 {
  nav_user[i].onmouseover = function(){fnNav(this,"block")};
  nav_user[i].onmouseout = function(){fnNav(this,"none")};
 }
}

var nav_zzjs = document.getElementById("nav_zzjs").childNodes;
for (var i=0;i<nav_zzjs.length;i++)
{
 if (nav_zzjs[i].className=="menu")
 {
  nav_zzjs[i].onmouseover = function(){fnNav(this,"block")};
  nav_zzjs[i].onmouseout = function(){fnNav(this,"none")};
 }
}
function fnNav(obj,flag)
{
 obj.getElementsByTagName("dl")[0].style.display = flag;
}

/*百度等外部来源显示提示*/

if(document.referrer.indexOf(location.host)==-1 && document.referrer!=''){

function levelcolse()
{
  var oBox=document.getElementById('boxPF');
   oBox.style.display='none';
}
var currentMoveObj = null;    //当前拖动对象
var relLeft;    //鼠标按下位置相对对象位置
var relTop;
function f_mdown(obj)
{
    currentMoveObj = obj;        //当对象被按下时，记录该对象
    currentMoveObj.style.position = "absolute";
    relLeft = event.x - currentMoveObj.style.pixelLeft;
    relTop = event.y - currentMoveObj.style.pixelTop;
}
window.document.onmouseup = function()
{currentMoveObj = null;    //当鼠标释放时同时释放拖动对象
}
function f_move(obj){if(currentMoveObj != null){currentMoveObj.style.pixelLeft=event.x-relLeft;currentMoveObj.style.pixelTop=event.y-relTop;}}

document.write('<div id="boxPF" onmousedown="f_mdown(this)" onmousemove="f_move(this)"><h2><div class="L">您知道吗？</div><div class="R"><a href="javascript:levelcolse();">×</a></div></h2><div class="cons"><p>通过<a href="http://www.haogouwu.com/">好购物网</a>到其它商城购物<br><a href="/list.php" target="_blank">最高可返50%！</a></p><p><a href="http://u.haogouwu.com/user/register.php">现在就去注册！！</a></p><p style="font-size:12px;"> <a href="http://u.haogouwu.com/read.php?id=34">账号注册开通教程</a><br><a title="淘宝聚划算省钱终级攻略——可在原有打折基础上再打折！" href="http://u.haogouwu.com/read.php?id=30" target="_blank">省钱终级攻略——原有打折基础上再打折！</a><br><a href="http://u.haogouwu.com/read.php?id=3">怎样通过“好购物”赚更多的钱？</a><br><a title="返钱后，还能享受商家原来的优惠吗？" href="http://u.haogouwu.com/read.php?id=8" target="_blank">返钱后，还能享受商家原来的优惠吗？</a></p></div></div><style type="text/css">#boxPF{width:500px;height:250px; border:8px solid #600; position:absolute;z-index:150;top:280px;left:280px;color:#FFC;}#boxPF .cons{filter:alpha(opacity=80); opacity:0.8;font-size:20px;font-weight: bold;text-align:center;background:#900; height:250px; }#boxPF a{color:#FFF;}#boxPF h2{ margin:0;height:25px;cursor:move;background:#200;border-bottom:2px solid #ccc;text-align:right;padding:0 10px;}#boxPF h2 a{color:#fff;font:25px Arial;text-decoration:none;outline:none;}</style>');
}
/*提示结束*/
