﻿$(document).ready(function(){
	/****************************************************************
	/* POPUP窗口功能函数
	/****************************************************************/
	$('a.poplight').click(function() {
		var popID = "AppPop";
		var popURL = $(this).attr('href');
		var popSZ = $(this).attr('rel'); 
		var Size= popSZ.split(',');
		$('#' + popID).fadeIn().css({ 'width': Number(Size[0]),'height':Number(Size[1]) }).prepend('<a href="#" class="close"><img src="/WebSite/Themes/WebSite/Public/Images/close_pop.png" class="btn_close" title="Close Window" alt="Close" /></a>');
		$('#' + popID).append("<iframe width='100%' height='100%' src='"+popURL+"' scrolling='no' frameborder=0></iframe>");
		
		var popMargTop = ($('#' + popID).height() + 80) / 2;
		var popMargLeft = ($('#' + popID).width() + 80) / 2;
		
		$('#' + popID).css({ 
			'margin-top' : -popMargTop,
			'margin-left' : -popMargLeft
		});
		$('body').append('<div id="fade"></div>'); //Add the fade layer to bottom of the body tag.
		$('#fade').css({'filter' : 'alpha(opacity=80)'}).fadeIn(); //Fade in the fade layer 
		
		return false;
	});
	$('a.close').live('click', function() { //When clicking on the close or fade layer...
		$('#fade , .popup_block').fadeOut(function() {
			$('#AppPop').html('');
			$('#fade, a.close').remove();  	
	});
		return false;
	});
	
	try{
		AutoRun();
	}catch(e){}
});

function postToWb(){
	var _t = encodeURI(document.title);
	var _url = encodeURIComponent(document.location);
	var _assname = encodeURI("ryoris");
	var _appkey = encodeURI("59f7f590576a4585b76c276aaf0646bf");
	var _pic = encodeURI('');//（例如：var _pic='图片url1|图片url2|图片url3....）
	var _site = 'http://www.d1w.net';//你的网站地址
	var _u = 'http://v.t.qq.com/share/share.php?url='+_url+'&appkey='+_appkey+'&site='+_site+'&pic='+_pic+'&title='+_t+'&assname='+_assname;
	window.open( _u,'', 'width=700, height=680, top=0, left=0, toolbar=no, menubar=no, scrollbars=no, location=yes, resizable=no, status=no' );
}
function postToWb1(title,url){
	var _t = encodeURI(title);
	var _url = encodeURIComponent(url);
	var _assname = encodeURI("ryoris");
	var _appkey = encodeURI("59f7f590576a4585b76c276aaf0646bf");
	//var _pic = encodeURI('');//（例如：var _pic='图片url1|图片url2|图片url3....）
	var _site = 'http://www.d1w.net';//你的网站地址
	var _u = 'http://v.t.qq.com/share/share.php?url='+_url+'&appkey='+_appkey+'&site='+_site+'&title='+_t+'&assname='+_assname;
	window.open( _u,'', 'width=700, height=680, top=0, left=0, toolbar=no, menubar=no, scrollbars=no, location=yes, resizable=no, status=no' );
}
