var AcafaAds;
var brOK=false;
var mie=false;
var vmin=2;
var vmax=5;
var vr=3;
var timer1;

function movechip(chipname, ww)
{
	if(brOK)
	{
		eval("chip="+chipname);
		if(!mie)
		{
			pageX=window.pageXOffset;
			pageW=window.innerWidth;
			pageY=window.pageYOffset;
			pageH=window.innerHeight;
		}
		else
		{
			pageX=window.document.body.scrollLeft;
			pageW=window.document.body.offsetWidth-8;
			pageY=window.document.body.scrollTop;
			pageH=window.document.body.offsetHeight;
		}
		chip.xx=chip.xx+chip.vx;
		chip.yy=chip.yy+chip.vy;
		chip.vx+=vr*(Math.random()-0.5);
		chip.vy+=vr*(Math.random()-0.5);
		if(chip.vx>(vmax+vmin))  chip.vx=(vmax+vmin)*2-chip.vx;
		if(chip.vx<(-vmax-vmin)) chip.vx=(-vmax-vmin)*2-chip.vx;
		if(chip.vy>(vmax+vmin))  chip.vy=(vmax+vmin)*2-chip.vy;
		if(chip.vy<(-vmax-vmin)) chip.vy=(-vmax-vmin)*2-chip.vy;
		if(chip.xx<=pageX)
		{
			chip.xx=pageX;
			chip.vx=vmin+vmax*Math.random();
		}
		if(chip.xx>=pageX+pageW-chip.w)
		{
			chip.xx=pageX+pageW-chip.w;
			chip.vx=-vmin-vmax*Math.random();
		}
		if(chip.xx>=pageW - ww -12)
		{
			chip.xx=chip.xx-20;
			chip.vx=-vmin-vmax*Math.random();
		}
		if(chip.yy<=pageY)
		{
			chip.yy=pageY;
			chip.vy=vmin+vmax*Math.random();
		}
		if(chip.yy>=pageY+pageH-chip.h)
		{
			chip.yy=pageY+pageH-chip.h;
			chip.vy=-vmin-vmax*Math.random();
		}
		if (document.getElementById)
		{
			document.getElementById(chip.named).style.left=chip.xx;
			document.getElementById(chip.named).style.top =chip.yy;
		}
		else if(document.layers)
		{
			eval('document.'+chip.named+'.top ='+chip.yy);
			eval('document.'+chip.named+'.left='+chip.xx);
		}
		else
		{
			eval('document.all.'+chip.named+'.style.pixelLeft='+chip.xx);
			eval('document.all.'+chip.named+'.style.pixelTop ='+chip.yy);
		}
		chip.timer1=setTimeout("movechip('"+chip.named+"'," + ww + ")",80);
	}
}

function StopMe(chipname)
{
	if(brOK)
	{
		eval("chip="+chipname);
		if(chip.timer1!=null)
		{
			clearTimeout(chip.timer1)
		}
	}
}

function AcafaAds(ww)
{
	var pageW;
	if(navigator.appName.indexOf("Internet Explorer")!=-1)
	{
		if(parseInt(navigator.appVersion.substring(0,1))>=4) brOK=navigator.javaEnabled();mie=true;
		pageW=window.document.body.offsetWidth-8;
	}
	if(navigator.appName.indexOf("Netscape")!=-1)
	{
		if(parseInt(navigator.appVersion.substring(0,1))>=4) brOK=navigator.javaEnabled();
		pageW=window.innerWidth;
	}

	AcafaAds.named="AcafaAds";
	AcafaAds.vx=vmin+vmax*Math.random();
	AcafaAds.vy=vmin+vmax*Math.random();
	AcafaAds.w=2;
	AcafaAds.h=2;
	AcafaAds.xx=pageW - ww - 20;
	AcafaAds.yy=0;
	AcafaAds.timer1=null;
	movechip("AcafaAds", ww);
}

function FloatAds(url,imgurl,title,ww)
{
	document.write('<div id="AcafaAds" style="height:'+(ww+1)+'px;left:178px;position:absolute;top:1237px;width:'+(ww+1)+'px; z-index:800">');
	document.write('<a title="' + title + '" href="' + url + '" target="_blank" onmouseover=StopMe("AcafaAds"); onmouseout=movechip("AcafaAds",' + ww + ');>');
	document.write('<img src="' + imgurl + '" border="0"></a></div>');
	AcafaAds(ww);
}

function getposOffset(what, offsettype){
	var totaloffset=(offsettype=="left")? what.offsetLeft : what.offsetTop;
	var parentEl=what.offsetParent;
	while (parentEl!=null){
		totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
		parentEl=parentEl.offsetParent;
	}
	return totaloffset;
}

function ToggleMenu(hpLink,classCode) {
	newsMenu = document.getElementById('change_stat'+classCode);

	newsMenu.style.left = getposOffset(hpLink, "left")-168;
	newsMenu.style.top = getposOffset(hpLink, "top") + hpLink.offsetHeight;

	if (newsMenu.style.visibility == "hidden") {
		newsMenu.style.visibility = "visible";
		newsMenu.style.display = 'block';
	} else {
		newsMenu.style.visibility = "hidden";
		newsMenu.style.display = 'none';
	}
}

function onLoginForm_KeyPress() 
{ 
	var e = event.srcElement; 
	if(event.keyCode == 13 && e.tagName == "INPUT" && e.type == "text") 
	{ 
		event.keyCode = 0;
	}
}


function ShowFlash(obj,strMediaURL,obj_width,obj_height){

	document.write('<OBJECT CLASSID="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"\n');
	document.write('  CODEBASE="http://active.macromedia.com/flash4/cabs/swflash.cab#version=4,0,2,0" ID='+obj+'  WIDTH='+obj_width+' HEIGHT='+obj_height+'>\n');
	document.write('  <PARAM NAME="movie" VALUE="'+strMediaURL+'">\n');
	document.write('  <PARAM NAME=play VALUE=true>\n');
	document.write('  <PARAM NAME=loop VALUE=true>\n');
	document.write('  <PARAM NAME=menu VALUE=true>\n');
	document.write('  <PARAM NAME=quality VALUE=high>\n');
	document.write('  <PARAM NAME=Wmode VALUE=transparent>\n');
	document.write('  <EMBED SRC="'+strMediaURL+'" name='+obj+' type=application/x-shockwave-flash SWLiveConnect=TRUE play=true loop=false menu=false width='+obj_width+' height='+obj_height+' scale=showall quality=best salign=BR loop=true pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" Wmode=transparent></EMBED>\n');
	document.write('</OBJECT>\n');
}

function ShowMovie(obj,strMediaURL,obj_width,obj_height){

	document.writeln('<object id="' + obj + '" width="' + obj_width + '" height="' + obj_height + '" ');
	document.writeln('	classid="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95" ');
	document.writeln('	codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,7,1112" ');
	document.writeln('	standby="Loading Microsoft Windows Media Player components..." ');
	document.writeln('	type="application/x-oleobject" align="middle">');
	document.writeln('<param name="src" value="' + strMediaURL + '">');
	document.writeln('<param name="FileName" value="' + strMediaURL + '">');
	document.writeln('<param name="ShowControls" value="ture">');
	document.writeln('<param name="ShowStatusBar" value="false">');
	document.writeln('<param name="ShowDisplay" value="false">');
	document.writeln('<param name="ShowPositionControls" value="true">');
	document.writeln('<param name="ShowAudioControls" value="true">');
	document.writeln('<param name="ShowTracker" value="true">');
	document.writeln('<param name="Volume" value="0">');
	document.writeln('<param name="DisplaySize" value="0">');
	document.writeln('<param name="AutoStart" value="true">');
	document.writeln('<param name="AutoRewind" value="true">');
	document.writeln('<embed type="application/x-mplayer2"');
	document.writeln('	pluginspage="http://www.microsoft.com/Windows/Downloads/Contents/Products/MediaPlayer/"');
	document.writeln('	name=MediaPlayer1');
	document.writeln('	showcontrols=1');
	document.writeln('	showstatusbar=0');
	document.writeln('	showdisplay=0');
	document.writeln('	showpositioncontrols=1');
	document.writeln('	showvolumecontrols=1');
	document.writeln('	showtracker=1');
	document.writeln('	volume=0');
	document.writeln('	displaysize=0');
	document.writeln('	autostart=1');
	document.writeln('	autorewind=1');
	document.writeln('	width=' + obj_width + '');
	document.writeln('	height=' + obj_height + '');
	document.writeln('	src="' + strMediaURL + '" filename="' + strMediaURL + '">');
	document.writeln('</embed>');
	document.writeln('</object>');
}

function ShowMusic(obj,obj_width,obj_height){

	document.writeln('<object classid="clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95" width="' + obj_width + '" height="' + obj_height + '" vspace="1" hspace="1" align="middle" id="Music" style="left:0px;top:0px;">');
	document.writeln('<param name="AllowChangeDisplaySize" value="true">');
	document.writeln('<param name="AllowScan" value="true">');
	document.writeln('<param name="AnimationAtStart" value="true">');
	document.writeln('<param name="AudioStream" value="-1">');
	document.writeln('<param name="AutoRewind" value="true">');
	document.writeln('<param name="AutoSize" value="false">');
	document.writeln('<param name="AutoStart" value="true">');
	document.writeln('<param name="Balance" value="0">');
	document.writeln('<param name="BufferingTime" value="5">');
	document.writeln('<param name="ClickToPlay" value="true">');
	document.writeln('<param name="CurrentMarker" value="0">');
	document.writeln('<param name="CurrentPosition" value="-1">');
	document.writeln('<param name="CursorType" value="0">');
	document.writeln('<param name="DisplayBackColor" value="0">');
	document.writeln('<param name="DisplayForeColor" value="16777215">');
	document.writeln('<param name="DisplayMode" value="0">');
	document.writeln('<param name="DisplaySize" value="2">');
	document.writeln('<param name="EnableContextMenu" value="true">');
	document.writeln('<param name="Enabled" value="true">');
	document.writeln('<param name="EnableFullScreenControls" value="false">');
	document.writeln('<param name="EnablePositionControls" value="true">');
	document.writeln('<param name="EnableTracker" value="true">');
	document.writeln('<param name="InvokeURLs" value="true">');
	document.writeln('<param name="Language" value="-1">');
	document.writeln('<param name="Mute" value="false">');
	document.writeln('<param name="PlayCount" value="1">');
	document.writeln('<param name="PreviewMode" value="false">');
	document.writeln('<param name="Rate" value="1">');
	document.writeln('<param name="SelectionEnd" value="-1">');
	document.writeln('<param name="SelectionStart" value="-1">');
	document.writeln('<param name="SendErrorEvents" value="true">');
	document.writeln('<param name="SendKeyboardEvents" value="false">');
	document.writeln('<param name="SendMouseClickEvents" value="true">');
	document.writeln('<param name="SendMouseMoveEvents" value="false">');
	document.writeln('<param name="SendOpenStateChangeEvents" value="true">');
	document.writeln('<param name="SendPlayStateChangeEvents" value="true">');
	document.writeln('<param name="SendWarningEvents" value="true">');
	document.writeln('<param name="ShowAudioControls" value="true">');
	document.writeln('<param name="ShowCaptioning" value="false">');
	document.writeln('<param name="ShowControls" value="true">');
	document.writeln('<param name="ShowDisplay" value="false">');
	document.writeln('<param name="ShowGotoBar" value="false">');
	document.writeln('<param name="ShowPositionControls" value="true">');
	document.writeln('<param name="ShowStatusBar" value="false">');
	document.writeln('<param name="ShowTracker" value="true">');
	document.writeln('<param name="TransparentAtStart" value="false">');
	document.writeln('<param name="VideoBorder3D" value="true">');
	document.writeln('<param name="VideoBorderColor" value="0">');
	document.writeln('<param name="VideoBorderWidth" value="0">');
	document.writeln('<param name="Volume" value="2000">');
	document.writeln('<param name="WindowlessVideo" value="false">');
	document.writeln('<embed type="application/x-mplayer2"');
	document.writeln('	pluginspage="http://www.microsoft.com/Windows/Downloads/Contents/Products/MediaPlayer/"');
	document.writeln('	name=MediaPlayer1');
	document.writeln('	AllowChangeDisplaySize=1');
	document.writeln('	AllowScan=1');
	document.writeln('	AnimationAtStart=1');
	document.writeln('	AudioStream=-1');
	document.writeln('	AutoRewind=1');
	document.writeln('	AutoSize=0');
	document.writeln('	AutoStart=1');
	document.writeln('	Balance=0');
	document.writeln('	BufferingTime=5');
	document.writeln('	ClickToPlay=1');
	document.writeln('	CurrentMarker=0');
	document.writeln('	CurrentPosition=-1');
	document.writeln('	CursorType=0');
	document.writeln('	DisplayBackColor=0');
	document.writeln('	DisplayForeColor=16777215');
	document.writeln('	DisplayMode=0');
	document.writeln('	DisplaySize=2');
	document.writeln('	EnableContextMenu=1');
	document.writeln('	Enabled=1');
	document.writeln('	EnableFullScreenControls=0');
	document.writeln('	EnablePositionControls=1');
	document.writeln('	EnableTracker=1');
	document.writeln('	InvokeURLs=1');
	document.writeln('	Language=-1');
	document.writeln('	Mute=0');
	document.writeln('	PlayCount=1');
	document.writeln('	PreviewMode=0');
	document.writeln('	Rate=1');
	document.writeln('	SelectionEnd=-1');
	document.writeln('	SelectionStart=-1');
	document.writeln('	SendErrorEvents=1');
	document.writeln('	SendKeyboardEvents=0');
	document.writeln('	SendMouseClickEvents=1');
	document.writeln('	SendMouseMoveEvents=0');
	document.writeln('	SendOpenStateChangeEvents=1');
	document.writeln('	SendPlayStateChangeEvents=1');
	document.writeln('	SendWarningEvents=1');
	document.writeln('	ShowAudioControls=1');
	document.writeln('	ShowCaptioning=0');
	document.writeln('	ShowControls=1');
	document.writeln('	ShowDisplay=0');
	document.writeln('	ShowGotoBar=0');
	document.writeln('	ShowPositionControls=1');
	document.writeln('	ShowStatusBar=0');
	document.writeln('	ShowTracker=1');
	document.writeln('	TransparentAtStart=0');
	document.writeln('	VideoBorder3D=1');
	document.writeln('	VideoBorderColor=0');
	document.writeln('	VideoBorderWidth=0');
	document.writeln('	Volume=2000');
	document.writeln('	WindowlessVideo=0');
	document.writeln('	width=' + obj_width + '');
	document.writeln('	height=' + obj_height + '');
	document.writeln('</embed>');
	document.writeln('</object>');
}


function slideLine(ul, delay, speed, lh) 
{
	var slideBox = (typeof ul == 'string')?document.getElementById(ul):ul;
	var delay = delay||1000, speed=speed||20, lh = lh||20;
	var tid = null, pause = false;
	var start = function() 
	{
		tid=setInterval(slide, speed);
	}
	
	var slide = function() 
	{
		if (pause) return;
		slideBox.scrollTop += 2;
		if (slideBox.scrollTop % lh == 0) 
		{
			clearInterval(tid);
			slideBox.appendChild(slideBox.getElementsByTagName('li')[0]);
			slideBox.scrollTop = 0;
			setTimeout(start, delay);
		}
	}
	slideBox.onmouseover=function(){pause=true;}
	slideBox.onmouseout=function(){pause=false;}
	setTimeout(start, delay);
}

function Show_TabMenu(tabadid_num,tabadnum,tmpMenu,tmpList,tmpClassOn,tmpItems){	
	for(var i=0;i<tmpItems;i++){document.getElementById(tmpMenu+tabadid_num+i).className="";}
	for(var i=0;i<tmpItems;i++){document.getElementById(tmpList+tabadid_num+i).style.display="none";}									
	
	document.getElementById(tmpMenu+tabadid_num+tabadnum).className=tmpClassOn;
	document.getElementById(tmpList+tabadid_num+tabadnum).style.display="block";								
}

function Show_TabMoreMenu(tabadid_num,tabadnum,tmpMenu,tmpMoreMenu, tmpList,tmpClassOn,tmpMoreClassOn,tmpItems){	
	for(var i=0;i<tmpItems;i++){document.getElementById(tmpMenu+tabadid_num+i).className="";}
	for(var i=0;i<tmpItems;i++){document.getElementById(tmpMoreMenu+tabadid_num+i).className="";}
	for(var i=0;i<tmpItems;i++){document.getElementById(tmpList+tabadid_num+i).style.display="none";}									
	
	document.getElementById(tmpMenu+tabadid_num+tabadnum).className=tmpClassOn;
	document.getElementById(tmpMoreMenu+tabadid_num+tabadnum).className=tmpMoreClassOn;
	document.getElementById(tmpList+tabadid_num+tabadnum).style.display="block";								
}

function Marquee(){
	var tmpWidth = document.getElementById(arguments[9]).clientWidth;
	var tmpHeight = document.getElementById(arguments[9]).clientHeight;
	
	if((arguments[1]==0||arguments[1]==1) && tmpHeight<=arguments[4])
		return;
		
	if((arguments[1]==2||arguments[1]==3) && tmpWidth<=arguments[3])
		return;
	
	this.ID=document.getElementById(arguments[0]);
	this.Direction=arguments[1];
	this.Step=arguments[2];
	
	if(arguments[3]>0)
		this.Width=arguments[3];
	
	if(arguments[4]>0)
		this.Height=arguments[4];
		
	
		
	this.Timer=arguments[5];
	this.WaitTime=arguments[6];
	this.StopTime=arguments[7];
	if(arguments[8])
		this.ScrollStep=arguments[8];
	else
		this.ScrollStep=this.Direction>1?this.Width:this.Height;
	this.CTL=this.StartID=this.Stop=this.MouseOver=0;
	this.ID.style.overflowX=this.ID.style.overflowY="hidden";
	this.ID.noWrap=true;
	
	if(arguments[3]>0)
		this.ID.style.width=this.Width;
		
	if(arguments[4]>0)
		this.ID.style.height=this.Height;
	
	this.ClientScroll=this.Direction>1?this.ID.scrollWidth:this.ID.scrollHeight;
	this.ID.innerHTML+=this.ID.innerHTML;
	this.Start(this,this.Timer,this.WaitTime,this.StopTime);
	}
	Marquee.prototype.Start=function(msobj,timer,waittime,stoptime){
	msobj.StartID=function(){
		msobj.Scroll();
		}
	msobj.Continue=function(){
		if(msobj.MouseOver==1)
		setTimeout(msobj.Continue,waittime);
		else{
		clearInterval(msobj.TimerID);
		msobj.CTL=msobj.Stop=0;
		msobj.TimerID=setInterval(msobj.StartID,timer);
		}
		}
	msobj.Pause=function(){
		msobj.Stop=1;
		clearInterval(msobj.TimerID);
		setTimeout(msobj.Continue,waittime);
		}
	msobj.Begin=function(){
		msobj.TimerID=setInterval(msobj.StartID,timer);
		msobj.ID.onmouseover=function(){
		msobj.MouseOver=1;
		clearInterval(msobj.TimerID);
		}
		msobj.ID.onmouseout=function(){
		msobj.MouseOver=0;
		if(msobj.Stop==0){
			clearInterval(msobj.TimerID);
			msobj.TimerID=setInterval(msobj.StartID,timer);
			}
		}
		}
	setTimeout(msobj.Begin,stoptime);
	}
	Marquee.prototype.Scroll=function(){
	switch(this.Direction){
		case 0:
		this.CTL+=this.Step;
		if(this.CTL>=this.ScrollStep&&this.WaitTime>0){
			this.ID.scrollTop+=this.ScrollStep+this.Step-this.CTL;
			this.Pause();
			return;
			}
		else{
			if(this.ID.scrollTop>=this.ClientScroll)
			this.ID.scrollTop-=this.ClientScroll;
			this.ID.scrollTop+=this.Step;
			}
		break;
		case 1:
		this.CTL+=this.Step;
		if(this.CTL>=this.ScrollStep&&this.WaitTime>0){
			this.ID.scrollTop-=this.ScrollStep+this.Step-this.CTL;
			this.Pause();
			return;
			}
		else{
			if(this.ID.scrollTop<=0)
			this.ID.scrollTop+=this.ClientScroll;
			this.ID.scrollTop-=this.Step;
			}
		break;
		case 2:
		this.CTL+=this.Step;
		if(this.CTL>=this.ScrollStep&&this.WaitTime>0){
			this.ID.scrollLeft+=this.ScrollStep+this.Step-this.CTL;
			this.Pause();
			return;
			}
		else{
			if(this.ID.scrollLeft>=this.ClientScroll)
			this.ID.scrollLeft-=this.ClientScroll;
			this.ID.scrollLeft+=this.Step;
			}
		break;
		case 3:
		this.CTL+=this.Step;
		if(this.CTL>=this.ScrollStep&&this.WaitTime>0){
			this.ID.scrollLeft-=this.ScrollStep+this.Step-this.CTL;
			this.Pause();
			return;
			}
		else{
			if(this.ID.scrollLeft<=0)
			this.ID.scrollLeft+=this.ClientScroll;
			this.ID.scrollLeft-=this.Step;
			}
		break;
	}
}

function ProductShowPassword(idStr)
{
	divPassWordMenu = document.getElementById('divPassWord');
    btnShow = document.getElementById(idStr);

    divPassWordMenu.style.left = getposOffset(btnShow, "left")+75;
    divPassWordMenu.style.top = getposOffset(btnShow, "top") + btnShow.offsetHeight-80;

    if (divPassWordMenu.style.visibility == "hidden") {
      divPassWordMenu.style.visibility = "visible";
      divPassWordMenu.style.display = 'block';
    } else {
      divPassWordMenu.style.visibility = "hidden";
      divPassWordMenu.style.display = 'none';
    }
	
}

function CompanyProductRedirectLoginPage()
{
	top.location.href = '/Login.aspx';
	
}