﻿function writeSwfLowVer(url, width, height, allowDomain, swfid) {
		allowDomain = true;
		if (allowDomain == "") {
			allowDomain = false;
		}
		if( (typeof swfid)=='undefined') {
			swfid = '';
		}

		try {

			document.write('<object id="'+swfid+'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="' + width + '" height="' + height + '">');
			document.write('<param name="movie" value="' + url + '">');
			if (allowDomain == true) {
				document.write('<param name="allowScriptAccess" value="sameDomain"/>');
			} else {
				document.write('<param name="allowScriptAccess" value="always"/>');
			}
			document.write('<param name="quality" value="high"><param name="wmode" value="transparent">');
			
			if (allowDomain == true) {
				document.write('<embed src="' + url + '" quality="high" wmode="transparent" allowscriptaccess="sameDomain" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="' + width + '" height="' + height + '"></embed>');
			}
			else{
				document.write('<embed src="' + url + '" quality="high" wmode="transparent" allowscriptaccess="always" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="' + width + '" height="' + height + '"></embed>');
			}			
			document.write('</object>');
		} catch(E){
			alert(E);
			}
		
		
	}


function fDWClick(url, popup)
	{				
		var clickurl = url;		
		
		if((typeof(popup)=='undefined' )||( popup=='')) {
			document.location.href=clickurl;
		}else {
			if(popup=="1")
				window.open(clickurl, 'mainpop');
			else
				window.open(clickurl, 'mainpop', popup);
				
		}
	}
	
function getuseraccount()
        {
           var Action='action=account';   
           var options={ 
                          method:'get', 
                          parameters:Action, 
                          onComplete:function(transport) 
                          { 
                              var returnvalue=transport.responseText; 
                              if (returnvalue.indexOf("??")>-1) 
                                 $("useracoount").innerHTML=''; 
                              else 
                                 $("useracoount").innerHTML=returnvalue; 
                          } 
                       }; 
          new  Ajax.Request('http://passport.letcen.com/userlogin.aspx?no-cache='+Math.random(),options);  
       }	
	   
function  ShowEngDate(object)
{   
	var strDay; 
	var strhours;
	var strEnglistDate;
	dayName = new Array("", "Mon", "Tue", "Wed", "Thur", "Fri", "Sat", "Sun") 
	monName = new Array("Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec") 
	now = new Date 
	if(now.getHours() <=12)
	{
		strhours = "am";
	}
	else
	{
		strhours ="pm";
	}
	strEnglistDate = monName[now.getMonth()] + " " +  now.getDate() + "," + now.getYear() +　" " + dayName[now.getDay()] + "," + now.getHours()+ ":" +now.getMinutes() + " " + strhours;	
	document.getElementById(object).innerHTML = strEnglistDate;
}


function  updateclick(chid,newsid)
{    
   var Action='action=update1&chid='+chid +'&id=' + newsid;   
           var options={ 
                          method:'get', 
                          parameters:Action, 
                          onComplete:function(clicknum){} 
                       }; 
          new  Ajax.Request('/inc/click.aspx?no-cache='+Math.random(),options); 
}

function  getNewsclick(chid,newsid,object)
{    
   var Action='action=getnum1&chid='+chid +'&id=' + newsid;   
           var options={ 
                          method:'get', 
                          parameters:Action, 
                          onComplete:function(transport){
						  	var returnvalue=transport.responseText;
							$(object).innerHTML ="点击：" + returnvalue;
						  } 
                       }; 
          new  Ajax.Request('/inc/click.aspx?no-cache='+Math.random(),options); 
}


function  getStoreStart(chid,newsid,object)
{    
   var Action='action=GetStart&chid='+chid +'&id=' + newsid;   
           var options={ 
                          method:'get', 
                          parameters:Action, 
                          onComplete:function(transport){
						  	var returnvalue=transport.responseText;							
							$(object).innerHTML = returnvalue;
						  } 
                       }; 
          new  Ajax.Request('/ShopComments.aspx?no-cache='+Math.random(),options); 
}



function setTab(name,cursel,n,css1,css2){ 
	for(i=1;i<=n;i++){ 
	  var menu=document.getElementById(name+i); 
	  var con=document.getElementById("Tab_"+name+"_"+i); 	  
	  menu.className=i==cursel?css1:css2; 
	  con.style.display=i==cursel?"block":"none"; 
	} 
} 

function setTab1(name,cursel,n,css1,css2){ 
	for(i=0;i<=n;i++){ 
	  var menu=document.getElementById(name+i); 
	  var con=document.getElementById("Tab_"+name+"_"+i); 	  
	  menu.className=i==cursel?css1:css2; 
	  con.style.display=i==cursel?"block":"none"; 
	} 
} 


function getchannellist()
{
           var Action='action=NewStorePost&ChID=0';   
           var options={ 
                          method:'get', 
                          parameters:Action, 
                          onComplete:function(transport) 
                          { 
                              var returnvalue=transport.responseText; 
                              if (returnvalue.indexOf("??")>-1) 
                                 $("channelpost").innerHTML='加载评论失败'; 
                              else 
                                 $("channelpost").innerHTML=returnvalue; 
                          } 
                       }; 
          new  Ajax.Request('/ShopComments.aspx?no-cache='+Math.random(),options);  
}



