// JavaScript Document
// Author     : BlueCharm

//===================================================================================================
//Procedure   : IsMail
//Description : Check the Object is Email or not !
//Parameter   : mail - The Object be Checked!
//Return      : Boolean
function IsMail(mail) 
{ 
    var RegularExpressions = /^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/; 
    if (!RegularExpressions.test(mail)) return true ; else return false; 
}
//===================================================================================================


//===================================================================================================
//Procedure   : IsOkStr
//Description : Check the String for username or password !
//Parameter   : str - The Object be Checked , l - the length of Object!
//Return      : Boolean
function IsOkStr(str,l) 
{ 
    var strInStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_";
	if (str.length<l){ return true; }
	else
	{
		for (i = 0; i < str.length; i++)
		{
			ch = str.charAt(i);
			for (j = 0; j < strInStr.length; j++){if(ch==strInStr.charAt(j)){break;}}
			if  (j == strInStr.length) return true;
		}
		return false;
	}	
}
//===================================================================================================


//===================================================================================================
//Procedure   : Flash
//Description : Show Flash !
//Parameter   : ur - url , w - witdh , h - height !
//Return      : 
function Flash(ur,w,h){
    document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="'+w+'" height="'+h+'"> ');
    document.write('<param name="movie" value="js/' + ur + '">');
    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="js/' + ur + '" pluginspage="http://www.macromedia.com/go/getflashplayer" quality="high" type="application/x-shockwave-flash" wmode="transparent" width="'+w+'" height="'+h+'"></embed>');
    document.write('</object> ');
}
//===================================================================================================


//===================================================================================================
//Procedure   : Roll
//Description : srolling level !
//Parameter   : w - width, c - the content of show
//Return      : 
function Roll(w,c)
{
    dcoument.write("<DIV id='roll' style='overflow:hidden; width:230px'>");
    dcoument.write("<TABLE width='100%' cellSpacing=0 cellPadding=0 border=0>");
	dcoument.write("<TBODY><TR><TD id='rollleft' align='middle'>");
    dcoument.write("<TABLE cellSpacing=0 cellPadding=0 border=0>");
    dcoument.write("<TBODY><TR><TD noWrap> "+c+" </TD></TR></TBODY>")
	dcoument.write("</TABLE></TD><TD id='rollright'></TD></TR></TBODY>")
	dcoument.write("</TABLE></DIV>");
	
	var speed=20;
    rollright.innerHTML=rollleft.innerHTML;
    function Marquee()
	{
		if ( rollright.offsetWidth-roll.scrollLeft<=0 ) 
		{   roll.scrollLeft-=rollleft.offsetWidth;    }
		else
		{   roll.scrollLeft++ ;  }
    }
    var MyMar=setInterval(Marquee,speed)
    roll.onmouseover=function() { clearInterval(MyMar); };
    roll.onmouseout =function() { MyMar=setInterval(Marquee,speed); };
}
//===================================================================================================