﻿
//显示Flash
function ShowFlash(url,width,height){
        document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="'+width+'" height="'+height+'" VIEWASTEXT>');
        document.write('<param name="movie" value="' + url + '">');
        document.write('<param name="quality" value="high"> ');
        document.write('<param name="wmode" value="transparent"> ');
        document.write('<param name="menu" value="false"> ');
        document.write('<embed src="' + url + '" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="'+width+'" height="'+height+'"></embed> ');
        document.write('</object> ');
}


function RefreshValidate()
{
		//obj.select();
		//alert('嘿嘿');
		document.getElementById("imgValidateCode").src = '/ValidateCode.aspx?rnd=' + parseInt(100*Math.random());
}


// ACLOUD 常用JS函数
 function getBid(s){
	 return document.getElementById(s);
 }
 
 function getBmc(s){
	 return document.getElementByName(s);
 }
 
 
 function dh(kg){
	var kg;
	var dhbox = document.getElementById("dhbox");
	if (kg=='on'){
	dhbox.style.display='block';
	}
	if (kg=='off'){
	dhbox.style.display='none';
	}
}
	
	
function bq(group,num){
var total=0;var group;var num;var i=1;
for (j=1;j<=25;j++){	
	if (document.getElementById("b"+[group]+"_"+[j])){
			total=j;
		}
	else{
			total=j;
			break;
		}
}
for (i=1;i<total;i++){
	if (i == num)
	{
		document.getElementById("b"+[group]+"_"+[i]).style.display='block';
		document.getElementById("bt"+[group]+"_"+[i]).className = 'bq' + group + '_' + 1;
	}
	else{
		document.getElementById("b"+[group]+"_"+[i]).style.display='none';
		document.getElementById("bt"+[group]+"_"+[i]).className = 'bq' + group + '_' + 2;
	}}
}

function hottag(num){
var num;
var isIE=!!window.ActiveXObject;
var isIE6=isIE&&!window.XMLHttpRequest;
var isIE8=isIE&&!!document.documentMode;
var isIE7=isIE&&!isIE6&&!isIE8;
for (i=1;i<7;i++){
if (i == num){
document.getElementById("settags"+num).style.background='url(/liangli/images/tags'+i+'.png) no-repeat';
if (isIE6){
document.getElementById("settags"+num).style.background='url(/liangli/images/tags'+i+'.gif) no-repeat';
}}else{
document.getElementById("settags"+i).style.background='none';
}}}



function selectmskey(keyNum){
  var keyNum;
  var seletTkey = new Array();
  var smstype = document.getElementById("smstype");
  for(x=1;x<6;x++){
	 seletTkey[x] = document.getElementById("smskey"+[x]);
  }
  for(sh=1;sh<6;sh++){
	  if (sh == keyNum){
		  seletTkey[sh].style.background = "url(/company/images/compy_info_navmenu.jpg)";
		  seletTkey[sh].style.fontWeight = "bolder";
		  smstype.value = sh ;
		  }
	  else{
		  seletTkey[sh].style.background = "none";
		  seletTkey[sh].style.fontWeight = "normal";
		  }
  }
}

function scrollInterval()
{
   demo2.innerHTML=demo1.innerHTML;
   //alert(demo1.scrollHeight-demo.offsetHeight-2);
   if(demo.scrollTop==2*demo1.scrollHeight-demo.offsetHeight)
   {
    demo.scrollTop=demo1.scrollHeight-demo.offsetHeight;
   }
   else
   {
    demo.scrollTop++;
   }
   if(demo.scrollTop%40==0)
   {
    window.setTimeout( "scrollInterval()", 1000 );
   }
   else 
   {
    window.setTimeout( "scrollInterval()", 20 );
   }
   //alert(demo.scrollTop);
}


//在非输入框时屏蔽Enter键
document.onkeydown=function()   
{           
      if(event.keyCode   ==   13)   
      {   
              if(event.srcElement.tagName.toLowerCase()   !=   "input")   
              event.returnValue   =   false;   
      }   
}

function keydown(buttonID) 
{
	if(event.keyCode==13) 	
	{ 
		try
		{ 
			event.keyCode=9;
			event.returnValue=false;       //取消事件
		    document.getElementById(buttonID).click();
		}
		catch(e)		
		{
			alert(e.message);
		}
	} 
	return false;
} 


//清除输入框的内容
function clearTextBox(txtName)
{
    var userName = document.getElementById(txtName);
    
    if(userName.value == "用户名")
    {
        userName.value="";
    }
}

function setTextBox(txtName)
{
    var userName = document.getElementById(txtName);
    
    if(userName.value == "")
    {
        userName.value="用户名";
    }
}

function clearPwd(txtPwd)
{
    var pwd = document.getElementById(txtPwd);
    
    if(pwd.value == "输入您的密码")
    {
        pwd.value="";
    }
}

function setPwd(txtPwd)
{
    var pwd = document.getElementById(txtPwd);
    
    if(pwd.value == "")
    {
        pwd.value="输入您的密码";
    }
}

function clearKeyWord(txtPwd)
{
    var pwd = document.getElementById(txtPwd);
    
    if(pwd.value == "请输入关键字")
    {
        pwd.value="";
    }
}

function setKeyWord(txtPwd)
{
    var pwd = document.getElementById(txtPwd);
    
    if(pwd.value == "")
    {
        pwd.value="请输入关键字";
    }
}

function checkSearch(xSearch)
{
    var txtSearch = document.getElementById(xSearch);
    if (txtSearch.value == '') {
        alert("请填写关键字.");
        txtSearch.focus();
        return false;
    }
}



	function checkedlogindata()
	{
		var userName = document.getElementById(getClientId().MemberName);
		if( userName.value == '' || userName.value =="用户名" )
		{
			alert("请填写您的用户名.");
			userName.focus();
			return false;
		}
		
		var password = document.getElementById(getClientId().Password);
		if( password.value == '' || password.value =="输入您的密码" )
		{
			alert("请填写登录密码..");
			password.focus();
			return false;
		}
		
	}

	function logout()
	{
		if (confirm("确定注销登录吗?"))
		{
			parent.location.href='/Login.aspx?action=logout';
		}
	}
	
	
	//替换文章关键字内链-----------------------
	function KeyData(key,url)
    {
        this.key=key;
        this.url=url;
    }
    
    function replaceKey()
    {
        var keyword=new Array(new KeyData("卸妆","http://lady.3mrw.com/Subjects/Topics-1-10.html"),
                              new KeyData("眼妆","http://lady.3mrw.com/Subjects/Topics-1-3.html"),
                              new KeyData("粉底","http://lady.3mrw.com/Subjects/Topics-1-13.html"),
                              new KeyData("马尾","http://lady.3mrw.com/Subjects/Topics-1-12.html"),
                              new KeyData("马尾辫","http://lady.3mrw.com/Subjects/Topics-1-12.html"),
                              new KeyData("发饰","http://lady.3mrw.com/Subjects/Topics-1-9.html"),
                              new KeyData("短发","http://lady.3mrw.com/Subjects/Topics-1-8.html"),
                              new KeyData("卷发","http://lady.3mrw.com/Subjects/Topics-1-7.html"),
                              new KeyData("直发","http://lady.3mrw.com/Subjects/Topics-1-6.html"),
                              new KeyData("梨花头","http://lady.3mrw.com/Subjects/Topics-1-2.html"),
                              new KeyData("美博会","http://www.wlmbh.com/"),                              
                              new KeyData("瘦腿","http://lady.3mrw.com/Subjects/Topics-1-19.html"),
                              new KeyData("瘦脸","http://lady.3mrw.com/Subjects/Topics-1-20.html"),
                              new KeyData("瘦腰","http://lady.3mrw.com/Subjects/Topics-1-21.html"),
                              new KeyData("丰胸","http://lady.3mrw.com/Subjects/Topics-1-18.html"),
                              new KeyData("黑眼圈","http://lady.3mrw.com/Subjects/Topics-1-11.html"),
                              new KeyData("面膜","http://lady.3mrw.com/Subjects/Topics-1-14.html"),
                              new KeyData("黑头","http://lady.3mrw.com/Subjects/Topics-1-15.html"),
                              new KeyData("祛痘","http://lady.3mrw.com/Subjects/Topics-1-4.html"),
                              new KeyData("防晒","http://lady.3mrw.com/Subjects/Topics-1-34.html"),
                              new KeyData("护发","http://lady.3mrw.com/Subjects/Topics-1-30.html"),
                              new KeyData("假发","http://lady.3mrw.com/Subjects/Topics-1-31.html"),
                              new KeyData("刘海","http://lady.3mrw.com/Subjects/Topics-1-28.html"),
                              new KeyData("睫毛膏","http://lady.3mrw.com/Subjects/Topics-1-16.html"),
                              new KeyData("烟熏妆","http://lady.3mrw.com/Subjects/Topics-1-17.html"),
                              new KeyData("祛斑","http://lady.3mrw.com/Subjects/Topics-1-40.html"),
                              new KeyData("保湿","http://lady.3mrw.com/Subjects/Topics-1-38.html"),
                              new KeyData("美白","http://lady.3mrw.com/Subjects/Topics-1-36.html"),
                              new KeyData("腮红","http://lady.3mrw.com/Subjects/Topics-1-33.html"),
                              new KeyData("唇彩","http://lady.3mrw.com/Subjects/Topics-1-32.html"),
                              new KeyData("唇膏","http://lady.3mrw.com/Subjects/Topics-1-29.html"),
                              new KeyData("翘臀","http://lady.3mrw.com/Subjects/Topics-1-27.html"),
                              new KeyData("去角质","http://lady.3mrw.com/Subjects/Topics-1-41.html"),
                              new KeyData("控油","http://lady.3mrw.com/Subjects/Topics-1-39.html"),
                              new KeyData("毛孔","http://lady.3mrw.com/Subjects/Topics-1-37.html"),
                              new KeyData("裸妆","http://lady.3mrw.com/Subjects/Topics-1-35.html"),                              
                              new KeyData("瘦小腿","http://lady.3mrw.com/Subjects/Topics-1-51.html"),
                              new KeyData("减肥食谱","http://lady.3mrw.com/Subjects/Topics-1-47.html"),
                              new KeyData("眼霜","http://lady.3mrw.com/Subjects/Topics-1-56.html"),
                              new KeyData("自制面膜","http://lady.3mrw.com/Subjects/Topics-1-55.html"),
                              new KeyData("减肥茶","http://lady.3mrw.com/Subjects/Topics-1-54.html"),
                              new KeyData("指甲油","http://lady.3mrw.com/Subjects/Topics-1-48.html"),
                              new KeyData("香水","http://lady.3mrw.com/Subjects/Topics-1-5.html"),
                              new KeyData("蜜粉","http://lady.3mrw.com/Subjects/Topics-1-50.html"),
                              new KeyData("画眼线","http://lady.3mrw.com/Subjects/Topics-1-53.html"),                              
                              new KeyData("化妆水","http://lady.3mrw.com/Subjects/Topics-1-77.html"),
                              new KeyData("健美操","http://lady.3mrw.com/Subjects/Topics-1-75.html"),
                              new KeyData("眼膜","http://lady.3mrw.com/Subjects/Topics-1-70.html"),
                              new KeyData("春季护肤","http://lady.3mrw.com/Subjects/Topics-1-72.html"),
                              new KeyData("胶原蛋白","http://lady.3mrw.com/Subjects/Topics-1-74.html"),
                              new KeyData("祛痘印","http://lady.3mrw.com/Subjects/Topics-1-64.html"),
                              new KeyData("保湿","http://lady.3mrw.com/Subjects/Topics-1-65.html"),
                              new KeyData("精华素","http://lady.3mrw.com/Subjects/Topics-1-66.html"),
                              new KeyData("发型设计","http://lady.3mrw.com/Subjects/Topics-1-73.html"),
                              new KeyData("眼线","http://lady.3mrw.com/Subjects/Topics-1-71.html"),
                              new KeyData("DIY发型","http://lady.3mrw.com/Subjects/Topics-1-69.html"),
                              new KeyData("发夹","http://lady.3mrw.com/Subjects/Topics-1-68.html"),
                              new KeyData("脱发","http://lady.3mrw.com/Subjects/Topics-1-63.html"),
                              new KeyData("淑女妆","http://lady.3mrw.com/Subjects/Topics-1-52.html"),
                              new KeyData("瘦手臂","http://lady.3mrw.com/Subjects/Topics-1-26.html"),
                              new KeyData("明星妆","http://lady.3mrw.com/Subjects/Topics-1-62.html"),
                              new KeyData("遮瑕","http://lady.3mrw.com/Subjects/Topics-1-61.html"),
                              new KeyData("化妆技巧","http://lady.3mrw.com/Subjects/Topics-1-60.html")
                              );
        
        var newcontent=divContent.innerHTML;
       
        for(i=0;i<keyword.length;i++)
        {            
            newcontent=newcontent.replace(new RegExp(keyword[i].key), '<a target="_blank" href="'+keyword[i].url+'" style="text-decoration:underline"><FONT color=#0000ff>'+keyword[i].key+'</FONT></a>');           
            
            re=new RegExp("title=(.*)<a target=\"_blank\" href=\""+keyword[i].url+"\" style=\"text-decoration:underline\"><FONT color=#0000ff>"+keyword[i].key+"</FONT></a>","gi");
            newcontent=newcontent.replace(re,"title=\"\"");
            
            re2=new RegExp("alt=(.*)<a target=\"_blank\" href=\""+keyword[i].url+"\" style=\"text-decoration:underline\"><FONT color=#0000ff>"+keyword[i].key+"</FONT></a>","gi");
            newcontent=newcontent.replace(re2,"alt=\"\"");
            
        }
        

        
//            re=new RegExp("title=(.[^>]*)style=","gi");
//            newcontent=newcontent.replace(re,"style=")
//            re2=new RegExp("alt=(.[^>]*)src=","gi");
//            newcontent=newcontent.replace(re2,"src=")

//       alert(newcontent);

        divContent.innerHTML=newcontent;
    }
    
    //-----------------------------------------------------------
