APPID = 4007001;
function verifyGo(con,act){
	var url = "http://yalu.qq.com/con/"+con+"/act/"+act
	if(con==""){
		con='default';
	}
	if(!checkqqload())
	{
		alert("请先使用您的QQ号码登录^_^");
		openLogin(4007001,url);
	}
	else{
		window.location.href = url;
	}	
}

function checkQQLogined()
{
	if(!checkqqload()){ //qq没有登录，先登录
		alert("请先使用您的QQ号码登录^_^");
		openLogin(4007001);
		window.scrollTo(0,0);
		return false;
	}
	return true;
	
}

function uploadPic(){
    //modify by karl 2008-11-15
    alert("活动已经截止，感谢您的参与！");
    //exit;
    /*
	if(document.formupload.pic.value!="" && document.formupload.description.value != ""){
		document.formupload.action = 'http://yalu.qq.com/con/upload/act/picsubmit';
		document.formupload.submit();
	}else{
		alert("请填写完整上传信息后，再进行上传！");
		exit;
	}
	*/
}

function uploadTxt(){
	//modify by karl 2008-11-15
    alert("活动已经截止，感谢您的参与！");
   // exit;
    /*
	if(document.formupload.text.value!="" && document.formupload.description.value != ""){
		if(document.formupload.text.len>400){
			alert("文章内容请限制在200个汉字以内！");
		}else {
			document.formupload.action = 'http://yalu.qq.com/con/upload/act/txtsubmit';
			document.formupload.submit();
		}
	}else{
		alert("请填写完整上传信息后，再进行上传！");
	}
	*/
}

function changePage(i,type,qq,order){
	var str="/con/list/act/"+type+"?p="+i+"&qq="+qq+"&order="+order;
	window.location.href = str;
}

function vote(_id, _fileByQQ, _fileType)
{	//modify by karl 2008-11-15
    alert("活动已经截止，感谢您的参与！");
    return;
	/*if(!checkqqload())
	{
		openLogin(4007001);
		alert("请先使用您的QQ号码登录^_^");
		return;
	}
	else
	{	
		qq_form(4007001, "", "", "", "", 2, "投票"
				, "http://yuting.qq.com/con/vote/act/saveAjax", _id,true,false,false
				,_fileByQQ,_fileType);
	}*/
}

function searchbarclear(){
	document.qqsearch.qq.value='';
}

function qqsearch($type){
	re = /^(\d+){5,}$/
	if(re.test(document.qqsearch.qq.value)){
		switch($type){
			case 1:
				$str = "pic";
				break;
			case 2:
				$str = "txt";
				break;
		}
		document.qqsearch.action='/con/list/act/'+$str+"?qq="+document.qqsearch.qq.value;
		document.qqsearch.submit();
	}else{
		alert("您输入的qq号有误，请重试！");
	}
}

function   SetImgSize(pimg,iw,ih)   {   
 var   img   =   new   Image(); 
 img.src = pimg.src;   
 var   w   =   iw;   
 var   h   =   ih;   
 
if(img.width>0 && img.height>0)
 {   
 if(img.width>iw||img.height>ih)
 {
   if((iw   /   ih)   >   (img.width   /   img.height))   
   {   
  h =  ih;   
  w   =   img.width   *   (ih   /   img.height);   
   }   
   else   
   {   
    w   =   iw;   
    h   =   img.height   *   (iw   /   img.width);   
   }   
  } 
 }
 else
 {
 w = iw;
 h = ih;
 }
 
 pimg.width=w;   
 pimg.height=h;   
 pimg.style.display="";  
}

//admin---------------------------------------------
function goPrePage(e)
{
	var curr_page = eval($('#curr_page').val())-1;
	var FState = $('#FState').val();
	var qq = $('#qq').val();
	
	$('#curr_page').val(curr_page);
	window.location = strUrl + "?curr_page=" + curr_page+ "&qq=" + qq + "&e=" +e;
}
function goNextPage(e)
{
	var curr_page = eval($('#curr_page').val())+1;
	var FState = $('#FState').val();
	var qq = $('#qq').val();
	$('#curr_page').val(curr_page);
	window.location = strUrl + "?curr_page=" + curr_page+ "&qq=" + qq +"&e="+e;
}
function goPage(e)
{
	var curr_page = eval($('#curr_page').val());
	var FState = $('#FState').val();
	var qq = $('#qq').val();
	if(e != null)
	{
		window.location = strUrl + "?curr_page=" + curr_page+ "&qq=" + qq+"&e="+e;
	}
	else
	{
		window.location = strUrl + "?curr_page=" + curr_page+ "&qq=" + qq;
	}
}

function checkinput()
{
	//alert(0);
	var i = 0;
	$('#FResult').val("");
	for(i = 0;i < g_iNumCount; ++i)
	{
		var ctl1 = $("#FIsCheck" + i + "_1");
		var ctl2 = $("#FIsCheck" + i + "_2");
		//alert("step 2");
		if(ctl1 != null && ctl2 != null)
		{
			if(ctl1.attr("checked") == true)
			{
				//alert("step 3");
				var value = $('#FResult').val();
				$('#FResult').val(value+";"+ctl1.val());
			}
			else if(ctl2.attr("checked") == true)
			{
				//alert("step 4");
				var value = $('#FResult').val();
				$('#FResult').val(value+";"+ctl2.val());
				//alert("step 5");
			}
			else
			{
				alert('请选择每一条记录的审核结果!');
				return false;
			}
		}
	}
	//alert($('#FResult').val());
	return true;
}

function setCheck(isCheck)
{
	var i = 0;
	for(;i < g_iNumCount; ++i)
	{
		var ctl1 = $("#FIsCheck" + i + "_1");
		var ctl2 = $("#FIsCheck" + i + "_2");
		//alert("step 2");
		if(ctl1 != null && ctl2 != null)
		{
			if(isCheck == 1)
			{
				ctl1.attr("checked",true);
				ctl2.attr("checked",false);
			}
			else
			{
				ctl1.attr("checked",false);
				ctl2.attr("checked",true);
			}			
		}
	}
}

function preSubmit()
{
	if(!checkinput())
	{
		return;
	}	
	$('#form1').submit();
}


function nchangeImg()
{
	var img = document.getElementById("imgVerify");
	img.src = "http://ptlogin2.qq.com/getimage?aid=" + APPID + "&" + Math.random();
	var ctrl = document.getElementById("verifycode");
	if (ctrl != null)
	{
		ctrl.value = "";
		ctrl.focus();
	}
	
}



function submitComm(){
	if(!checkqqload()){
		openLogin(4007001);
		alert("请先使用您的QQ号码登录^_^");
		return;
	}else{
		document.formcomm.action = "/con/view/act/com";
		document.formcomm.submit();
	}
}
//---------------------------------------------------------
