//公共
function _SMS() {
	jQuery.ajax({
		type: 'GET',
		url: 'desktop.php?do=sms&date='+new Date(),
		success: function(data){
			if(data!=''){
				//alert(data);
				$("#_SMS").html(data);
			}
		}
	});
}
function _SmsShow(name) {
	if(name){
		var name=name;
	}else{
		var name='';
	}
	jQuery.ajax({
		type: 'GET',
		url: 'desktop.php?do=SmsShow&name='+name+'&date='+new Date(),
		success: function(data){
			if(data!=''){
				$("#_SmsShow").html(data);
			}
		}
	});
	window.setTimeout(_SmsShow,120*5*1000);
}
function _Sms_hide(){
	$('.showChat_inner').hide();
}
function _SmsContact(sid) {
    //$('.showChat_inner').hide();
    $('.showChat_inner').show();
	jQuery.ajax({
		type: 'GET',
		url: 'desktop.php?do=SmsBack&sid='+sid+'&date='+new Date(),
		success: function(data){
			if(data!=''){
				$("#_SmsBack").html(data);
				_SmsMsg(sid);
			}
		}
	});
}
function _SmsMsg(sid) {
	var _sid=$('input[name="sid"]').val();
	if(sid!=0){
		jQuery.ajax({
			type: 'GET',
			url: 'desktop.php?do=SmsMsg&sid='+_sid+'&date='+new Date(),
			success: function(data){
				if(data!=''){
					$("#_SmsMsg").html(data);
					var div = document.getElementById('_SmsMsg');
					div.scrollTop = div.scrollHeight;
				}
			}
		});
		window.setTimeout('_SmsMsg('+sid+');',10*2*1000);
	}
}
function _SmsAdd() {
	var sid=$('input[name="sid"]').val();
	var Sms_User=$('input[name="Sms_User"]').val();
	var SMS_CONTENT=$('input[name="SMS_CONTENT"]').val();
	if(Sms_User!=''){
		jQuery.ajax({
			type: 'GET',
			url: 'desktop.php?do=SmsAdd&sid='+sid+'&Sms_User='+Sms_User+'&SMS_CONTENT='+escape(SMS_CONTENT)+'&date='+new Date(),
			success: function(data){
				if(data!=''){
					_SmsMsg(sid);
					$('input[name="SMS_CONTENT"]').val('');
				}
			}
		});
	}
}
function _Layouttype(e) {
    if("dark" == e){
		$(".pcoded-header").attr("header-theme", "theme1");
		$(".pcoded-navbar").attr("navbar-theme", "theme1");
		$(".pcoded").attr("sidebar-img", "false");
		$("body").addClass("dark"), $(".pcoded-navigation-label").attr("menu-title-theme", "theme6");
	}
    if("light" == e){
		$(".pcoded-header").attr("header-theme", "theme5");
		$(".pcoded-navbar").attr("navbar-theme", "themelight1");
		$(".pcoded").attr("sidebar-img", "false");
		$(".pcoded-navigation-label").attr("menu-title-theme", "theme1");
		$("body").removeClass("dark");
	}
    if("img" == e){
		$(".pcoded-header").attr("header-theme", "theme1");
		$(".pcoded-navbar").attr("navbar-theme", "theme1");
		$(".navbar-logo").attr("logo-theme", "theme1");
		$(".pcoded").attr("sidebar-img", "true");
		$(".pcoded-navigation-label").attr("menu-title-theme", "theme6");
	}
}
function vertical(e){//='dashed'
	$(".pcoded-navbar .pcoded-item").attr("item-border-style", e);
}
function verticalico(e){//='style1'
	$(".pcoded-navbar .pcoded-hasmenu").attr("dropdown-icon", e);
}
function verticalsubitem(e){//='style7'
	$(".pcoded-navbar .pcoded-hasmenu").attr("subitem-icon", e);
}
function themecolor(e,t){//e='theme2',t='theme2'
	$(".pcoded-header").attr("header-theme", e);
    $(".pcoded-navbar").attr("active-item-theme", t);
}
function navbgpattern(e){//='img5'
	$(".pcoded").attr("sidebar-img-type", e);
}
function styleadd(type){
	var Layouttype=$('input[name="Layouttype"]').val();
	var handlemenutype=$('input[name="handlemenutype"]').val();
	var vertical=$('input[name="vertical"]').val();
	var verticalico=$('input[name="verticalico"]').val();
	var verticalsubitem=$('input[name="verticalsubitem"]').val();
	var themecolor=$('input[name="themecolor"]').val();
	var navbgpattern=$('input[name="navbgpattern"]').val();
	if(Layouttype){
		jQuery.ajax({
			type: 'GET',
			url: 'desktop.php?do=styleadd&Layouttype='+Layouttype+'&handlemenutype='+handlemenutype+'&vertical='+vertical+'&verticalico='+verticalico+'&verticalsubitem='+verticalsubitem+'&themecolor='+themecolor+'&navbgpattern='+navbgpattern+'&type='+type+'&date='+new Date(),
			success: function(data){
				if(data){
					alert(data);
				}
			}
		});
	}
}