function searchFriendIndex(boolVal){
	var str = "在WOYO寻找你的朋友";
	var tmpVal = "";
	tmpVal = $("#searchValue").val();
	tmpVal = $.trim(tmpVal);
	if(boolVal==1){
		if(tmpVal==str){
			$("#searchValue").val('');
		}
	}else{
		if(tmpVal==''){
			$("#searchValue").val(str);
		}
	}

}

function doIndexSearch () {
	var url='http://search.woyo.com/result.php?act=base&keyword='+encodeURIComponent($.id('searchValue').value);
	location.href =url;
}

function woyoLoginIndex(typeVal,boolVal){
	var tmpVal = "";
	if(typeVal==1){//手机
		var str = "邮箱/帐号";
		tmpVal = $("#email").val();
		tmpVal = $.trim(tmpVal);
		if(boolVal==1){
			if(tmpVal==str){
				$("#email").val('');
			}
		}else{
			if(tmpVal==''){
				$("#email").val(str);
			}
		}
	
	}else{//密码
		var strPwd = "密 码";
		tmpVal = $("#password").val();
		tmpVal = $.trim(tmpVal);
		if(boolVal==1){
			if(tmpVal==strPwd){
				$("#password").val('');
			}
		}else{
			if(tmpVal==''){
				$("#password").val(strPwd);
			}
		}
	}
}

function checkWoyoLoginKeyDown(e){
	if(jQuery.browser.msie){
		if(event.keyCode == 13){
			$.id("loginButton").onclick();
			return false;
		}
	}else{
		if(e.which == 13)
		{	
			
			$.id("loginButton").onclick();
			return false;
		}
	}
	return true;
}

function playVideo(hid, did, title, videoUrl, imgUrl, tag) {
	if ($(".cur").length==0) {
		$('#tiny_video li:first').addClass('cur');
	} else {
		$('#tiny_video li').removeClass('cur');
		$(tag).parent().addClass('cur');
	}
	
    $('#video_show').createSwf({
        src     : 'http://image.woyo.com/swf/comm/gbook_player.swf',
        id 	    : 'fm',
        w		: '213',
        h		: '135',
        ver		: 9,
        vars	: {
            id	       : did + ',' + hid,
            swfurl     : 'http://image.woyo.com/swf/comm',
            width      : '213',
            height     : '135',
            ifAutoPlay : 0,
            local      : 'http%3A%2F%2Fvideo.woyo.com%2F%3Fgo%3Dplayer%26hid%3D' + hid + '%26did%3D' + did,
            hasBGImage : 1,
            bgImage : imgUrl
        },
        params	: {menu:'false',wmode:'transparent',allowScriptAccess:'always',allowFullScreen :'true'}
    });
    $('#video_title').html("<a href='" + videoUrl + "' target='_blank'>" + title + "</a>");
}

function goItem(o){
	$("#pg span").removeClass("cur");
	$("#p_"+o+"").addClass("cur");
	$(".oss-item").hide();
	$("#oss_"+o+"").show();
}

$(document).ready(function(){
/*
	var timer=5000;
	var CAN=false;
	$("#kv_switch").html("<span id='kv_a'>用户时钟</span><span id='kv_b'>banner</span>");
	$("#kv").hover(function(){$("#kv_switch").fadeIn("slow");},function(){$("#kv_switch").fadeOut("slow");})
	$("#kv_a").click(function(){
		$("#oss").hide();
		$("#girl_clock").show();
		$("#kv_switch").css("background-position","-20px 0");
	});
	$("#kv_b").click(function(){
		CAN=true;
		$("#pg span:first").addClass("cur");
		$("#girl_clock").hide();
		$("#oss").show();
		$("#kv_switch").css("background-position","0 0");
	});
	var OIL=$(".oss-item").length;
	var str="";
	for(var x=0;x<OIL;x++){
		str+="<span id='p_"+(x+1)+"' onclick='goItem("+(x+1)+")'>"+(x+1)+"</span>"
	}
	$("#pg").html(str);
	var y=1;
	window.setInterval(function(){
		if(CAN){
			goItem(y+1);	
			y++;
			if(y==OIL){y=0}
		}else{y=0}
	},timer);
	*/
});
