// JavaScript Document
function resize(o) {
	if (o.width>500) {
	o.style.width='500px';
	o.style.height='auto';
	}
}
function objSP_Article() {this.ImgUrl="";} //this.LinkUrl=""; this.Title="";}
function SlidePic_Article(_id) {this.ID=_id; this.Width=0;this.Height=0; this.TimeOut=5000; this.Effect=23; this.TitleLen=0; this.PicNum=-1; this.Img=null; this.Url=null; this.Title=null; this.AllPic=new Array(); this.Add=SlidePic_Article_Add; this.Show=SlidePic_Article_Show; this.LoopShow=SlidePic_Article_LoopShow;}
function SlidePic_Article_Add(_SP) {this.AllPic[this.AllPic.length] = _SP;}
function SlidePic_Article_Show() {
  if(this.AllPic[0] == null) return false;
  document.write("<div align='left'><a id='Url_" + this.ID + "' target='_blank'><img id='Img_" + this.ID + "' style='width:" + this.Width + "px; height:" + this.Height + "px; filter: revealTrans(duration=2,transition=23);' src='javascript:null' border='0'></a>");
  if(this.TitleLen != 0) document.write("<br><span id='Title_" + this.ID + "'></span></div>");
  this.Img = document.getElementById("Img_" + this.ID);
  this.Url = document.getElementById("Url_" + this.ID);
//  this.Title = document.getElementById("Title_" + this.ID);
  this.LoopShow();
}
function SlidePic_Article_LoopShow() {
  if(this.PicNum<this.AllPic.length-1) this.PicNum++ ; 
  else this.PicNum=0; 
  this.Img.filters.revealTrans.Transition=this.Effect; 
  this.Img.filters.revealTrans.apply(); 
  this.Img.src=this.AllPic[this.PicNum].ImgUrl;
  this.Img.filters.revealTrans.play();
  this.Url.href=this.AllPic[this.PicNum].LinkUrl;
  if(this.Title) this.Title.innerHTML="<a href="+this.AllPic[this.PicNum].LinkUrl+" target=_blank>"+this.AllPic[this.PicNum].Title+"</a>";
  this.Img.timer=setTimeout(this.ID+".LoopShow()",this.TimeOut);
}



tPopWait=50;  
tPopShow=5000;  
showPopStep=20;  
popOpacity=99;  
  
sPop=null;  
curShow=null;  
tFadeOut=null;  
tFadeIn=null;  
tFadeWaiting=null;

  
document.write("<style type='text/css' id='defaultPopStyle'>");  
document.write(".cPopText {width:300px;font-size:12px;font-weight:bold;background-color: #FFFFFF; border: 4px #FF8000 solid;color:#000; font-size: 12px; padding:6px 4px 4px 4px;filter: Alpha(Opacity=0)}");  
document.write("</style>");  
document.write("<div id='dypopLayernnn' style='position:absolute;z-index:1000;text-align:left;")
if(!document.all)
{
	document.write(" display:none;'")
}
document.write("class='cPopText'></div>");  
var dypopLayer=document.getElementById("dypopLayernnn"); 


function getEvent()
{
	if(document.all)
	{
		return window.event;//Èç¹ûÊÇie
	}
	func=getEvent.caller;
	while(func!=null)
	{
		var arg0=func.arguments[0];
		if(arg0)
		{
			if((arg0.constructor==Event || arg0.constructor ==MouseEvent)||(typeof(arg0)=="object" && arg0.preventDefault && arg0.stopPropagation))
			{
				return arg0;
			}
		}
		func=func.caller;
	}
	return null;
}



function showPopupText(){
	var evt=getEvent();
	var o=evt.srcElement || evt.target;
	MouseX=evt.x ? evt.x : evt.pageX;  
	MouseY=evt.y ? evt.y : evt.pageY;
	
	if(o.alt!=null && o.alt!=""){o.dypop=o.alt;o.alt=""};  
    if(o.title!=null && o.title!=""){o.dypop=o.title;o.title=""};
	if(o.dypop!=sPop) {  
			sPop=o.dypop;  
			clearTimeout(curShow);  
			clearTimeout(tFadeOut);  
			clearTimeout(tFadeIn);  
			clearTimeout(tFadeWaiting);	  
			if(sPop==null || sPop=="") {  
				dypopLayer.innerHTML="";  
				dypopLayer.style.filter="Alpha()";  
				dypopLayer.filters.Alpha.opacity=0;	  
				}  
			else {  
				if(o.dyclass!=null) popStyle=o.dyclass   
					else popStyle="cPopText";
				curShow=setTimeout("showIt()",tPopWait);  
			}  
			  
	}  
}  
  
  
function fadeOut(){  
	if(dypopLayer.filters.Alpha.opacity<popOpacity) {  
		dypopLayer.filters.Alpha.opacity+=showPopStep;  
		tFadeOut=setTimeout("fadeOut()",1);  
		}  
		else {  
			dypopLayer.filters.Alpha.opacity=popOpacity;  
			tFadeWaiting=setTimeout("fadeIn()",tPopShow);  
			}  
}  
function fadeIn(){  
	if(dypopLayer.filters.Alpha.opacity>0) {  
		dypopLayer.filters.Alpha.opacity-=1;  
		tFadeIn=setTimeout("fadeIn()",1);  
		}  
}  
document.onmouseover=showPopupText;  
function showIt(){  
		if(document.all)
		{}
		else
		{
			dypopLayer.style.display="";
		}
		dypopLayer.className=popStyle;  
		dypopLayer.innerHTML=sPop;  
		popWidth=dypopLayer.clientWidth;  
		popHeight=dypopLayer.clientHeight;  
		
		
		if(MouseX+12+popWidth>document.body.clientWidth) popLeftAdjust=-popWidth-24  
			else popLeftAdjust=0;  
		if(MouseY+12+popHeight>document.body.clientHeight) popTopAdjust=-popHeight-24  
			else popTopAdjust=0;  
			
		dypopLayer.style.left=parseInt(MouseX)+12+parseInt(document.body.scrollLeft)+parseInt(popLeftAdjust)+"px";  
		dypopLayer.style.top=parseInt(MouseY)+12+parseInt(document.body.scrollTop)+parseInt(popTopAdjust)+"px"; 
		if(document.all)
		{
			dypopLayer.style.filter="Alpha(Opacity=0)";
			fadeOut();
		}
		else
		{
			setTimeout("guangbi()",20000);  
		}
		  
}  
function guangbi()
{	
	dypopLayer.style.display="none";
}
function Ck_Login(theForm)
{
	if(theForm.email.value=="")
	{
		alert("Please enter a value for the \" Email\" field.");
		theForm.email.focus();
		return false;
	}
	 if (theForm.email.value != "")
	  {
		var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i
		if (!filter.test(theForm.email.value)){
			alert("Please Enter a valid Email Address!")
			theForm.email.focus();
			return false;
		}
	  }
	if(theForm.password.value=="")
	{
		alert("Please enter a value for the \" Password\" field.");
		theForm.password.focus();
		return false;
	}
}
function showfaq()
{
	var xuanzeID=document.contactForm.subjects.value;
	if (xuanzeID>=4 && xuanzeID<=11)
	{
		document.getElementById('contact1').style.display='none';
		document.getElementById('contact2').style.display='none';
		}
	else
	{
		document.getElementById('contact1').style.display='';
		document.getElementById('contact2').style.display='';
		}
	for (i=4; i<=11; i++)
	{
		if (xuanzeID==i)
		{
			document.getElementById('faq'+i).style.display='';
			}
		else
		{
			document.getElementById('faq'+i).style.display='none';
			}
		}
	}
function CkContactForm(theForm)
{
	if (theForm.subjects.value == "0" )	{
		alert("Please select subject.");
		theForm.subjects.focus();
		return (false);
	}
 
	  if (theForm.name.value == "")
	  {
		alert("Please enter a value for the \" Name\" field.");
		theForm.name.focus();
		return (false);
	  }
	 
	  if (theForm.name.value.length < 2)
	  {
		alert("Please enter at least 2 characters in the \"Name\" field.");
		theForm.name.focus();
		return (false);
	  }
	 
	   if (theForm.email.value == "")
	  {
		alert("Please enter a value for the \"Email\" field.");
		theForm.email.focus();
		return (false);
	  }else{
	  var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i
		if (!filter.test(theForm.email.value)){
			alert("Please Enter a valid Email Address!")
			theForm.email.focus();
			return false;
		}
	  }
	  if (theForm.message.value == "")
	  {
		alert("Please enter a value for the \"message\" field.");
		theForm.message.focus();
		return (false);
	  }
	}

function Partner_Form_Validator(theForm)
{ 
   if (theForm.business_name.value == "")
  {
    alert("Please enter a value for the \" Name Of Business\" field.");
    theForm.business_name.focus();
    return (false);
  }
  if (theForm.contact_name.value == "")
  {
    alert("Please enter a value for the \" Contact Name\" field.");
    theForm.contact_name.focus();
    return (false);
  }
   if (theForm.country.value == "")
  {
    alert("Please enter a value for the \" Country\" field.");
    theForm.country.focus();
    return (false);
  }
   if (theForm.city.value == "")
  {
    alert("Please enter a value for the \" City\" field.");
    theForm.city.focus();
    return (false);
  }
  if (theForm.business_sales.value == "")
  {
    alert("Please enter a value for the \" Expected monthly sales\" field.");
    theForm.business_sales.focus();
    return (false);
  } 
  if (theForm.email.value == "")
  {
    alert("Please enter a value for the \"Email\" field.");
    theForm.email.focus();
    return (false);
  }
  else
  {
	   var
		filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i
		if (!filter.test(theForm.email.value))
		{
			alert("Please Enter a valid Email Address!")
			theForm.email.focus();
			return false;
		}
  }
  if (theForm.partner_pass.value == "")
  {
    alert("Please Enter a value for 'Password'");
    theForm.partner_pass.focus();
    return (false);
  }
  if (theForm.partner_pass.value.length<6 || theForm.partner_pass.value.length>20 )
  {
    alert("The correct password length not 6-10!");
    theForm.partner_pass.focus();
    return (false);
  }
 if (theForm.partner_pass.value != theForm.password2.value)
  {
    alert("Please Enter the same password for value for 'Renter Password'");
    theForm.password2.focus();
    return (false);
  }
  if (GetRadioValue("IsStore")=="Yes" && theForm.numberStores.value=="")
  {
	alert("Please Enter the same password for value for 'Renter Stores'");
	theForm.numberStores.focus();
	return (false)
  }
 }
function GetRadioValue(RadioName){
    var obj;    
    obj=document.getElementsByName(RadioName);
    if(obj!=null){
        var i;
        for(i=0;i<obj.length;i++){
            if(obj[i].checked){
                return obj[i].value;            
            }
        }
    }
    return null;
} 
 
 function Affiliates_Form_Validator(theForm)
{ 
  if (theForm.partner_firstname.value == "")
  {
    alert("Please enter a value for the \" First Name\" field.");
    theForm.partner_firstname.focus();
    return (false);
  }
  if (theForm.partner_lastname.value == "")
  {
    alert("Please enter a value for the \" Last name\" field.");
    theForm.partner_lastname.focus();
    return (false);
  }
  if (theForm.Paypal_email.value == "")
  {
    alert("Please Select a value for the \" PayPal email\" ");
    theForm.Paypal_email.focus();
    return (false);
  }
  if (theForm.email.value == "")
  {
    alert("Please enter a value for the \"Email\" field.");
    theForm.email.focus();
    return (false);
  }
  else
  {
	   var
		filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i
		if (!filter.test(theForm.email.value))
		{
			alert("Please Enter a valid Email Address!")
			theForm.email.focus();
			return false;
		}
  }
 if (theForm.partner_pass.value == "")
  {
    alert("Please Enter a value for 'Password'");
    theForm.partner_pass.focus();
    return (false);
  }
if (theForm.partner_pass.value.length<6 || theForm.partner_pass.value.length>20 )
  {
	alert("The correct password length not 6-10!");
	theForm.partner_pass.focus();
	return (false);
  }
 if (theForm.partner_pass.value != theForm.password2.value)
  {
    alert("Please Enter the same password for value for 'Renter Password'");
    theForm.password2.focus();
    return (false);
  }

 }
 function ckcomment(theForm)
 {
	 if (theForm.comment.value == "")
	  {
		alert("Please Enter a value for 'Message'");
		theForm.comment.focus();
		return (false);
	  }
	 }
	 
	 
function Affiliates_Form_Validator2(theForm)
{ 
  if (theForm.partner_firstname.value == "")
  {
    alert("Please enter a value for the \" First Name\" field.");
    theForm.partner_firstname.focus();
    return (false);
  }
  
  if (theForm.email.value == "")
  {
    alert("Please enter a value for the \"Email\" field.");
    theForm.email.focus();
    return (false);
  }
  else
  {
	   var
		filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i
		if (!filter.test(theForm.email.value))
		{
			alert("Please Enter a valid Email Address!")
			theForm.email.focus();
			return false;
		}
  }
 

 if (theForm.partner_pass.value == "")
  {
    alert("Please Enter a value for 'Password'");
    theForm.partner_pass.focus();
    return (false);
  }

 if (theForm.partner_pass.value != theForm.password2.value)
  {
    alert("Please Enter the same password for value for 'Renter Password'");
    theForm.password2.focus();
    return (false);
  }

  document.theForm.action.value="mail"
  return (true);

 }
 

function Warnkuang()   
{ 
	var mess ="Are you sure you want to execute? Unable to recover after!"; 
	var question = confirm(mess); 
	if(question=='0 ') 
	{ 
		return   false; 
	} 
	else 
	{ 
		return  true; 
	} 
} 


function Ck_LinkAdd(theForm)
{
	
	if(theForm.title.value=="")
	{
		alert("Please enter a value for the \" Seit Title\" field.");
		theForm.title.focus();
		return false;
	}
	if(theForm.url.value=="")
	{
		alert("Please enter a value for the \" Url\" field.");
		theForm.url.focus();
		return false;
	}
	if(theForm.fullname.value=="")
	{
		alert("Please enter a value for the \" Full Name\" field.");
		theForm.fullname.focus();
		return false;
	}
	if(theForm.email.value=="")
	{
		alert("Please enter a value for the \" Email\" field.");
		theForm.email.focus();
		return false;
	}
	 if (theForm.email.value != "")
	  {
		var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i
		if (!filter.test(theForm.email.value)){
			alert("Please Enter a valid Email Address!")
			theForm.email.focus();
			return false;
		}
	  }
	  if(theForm.page.value=="")
	{
		alert("Please enter a value for the \" Reciprocal page\" field.");
		theForm.page.focus();
		return false;
	}
}