// Determine the browser type
Function GetIEType ()
{
Var Sys = {};
Var nvg = navigator. userAgent. toLowerCase ();
Var rslt;
If (window. ActiveXObject)
{
Sys. ie = nvg. match (/msie ([\ d.] +)/) [1];
}
(Rslt = nvg. match (/firefox \/([\ d.] + )/))? Sys. firefox = rslt [1]:
(Rslt = nvg. match (/chrome \/([\ d.] + )/))? Sys. chrome = rslt [1]:
(Rslt = nvg. match (/version \/([\ d.] +). * safari /))? Sys. safari = rslt [1]: 0;
If (Sys. ie)
{
Alert ('ie: '+ Sys. IE );
}
If (Sys. firefox)
{
Alert ('Firefox: '+ Sys. Firefox );
}
If (Sys. chrome)
{
Alert ('chrome: '+ Sys. Chrome );
}
If (Sys. safari)
{
Alert ('safari: '+ Sys. Safari );
}
}
// Enter the full-width space ------------------------
// Replace "empty" with spaces.
String. prototype. trim = function ()
{
Return this. replace (/[delimiter *] | [*]/g ,"");
}
// Remove the left space
String. prototype. ltrim = function ()
{
Return this. replace (/^ [replacement *] | [*]/g ,"");
}
// Remove right space
String. prototype. rtrim = function ()
{
Return this. replace (/[replace *] | [*] * $ /,"");
}
// Match the Email format
Function check_email (email)
{
If (email. match (/^ [-+ 0-9a-z. = _ \/] + @ ([-0-9a-z] + \.) + [a-z] {2, 6} $/I ))
Return true;
Else
{
Alert ("Error! ");
Return false;
}
}
// Close the current window automatically
Window. onload = function ()
{
Window. setTimeout ("next ();", 3000 );
};
Function next ()
{
Alert ("OK ");
}