var plugin=(navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0;

function flash(arg,w,h,path,img) {

if ( plugin ) {
        plugin=parseInt(plugin.description.substring(plugin.description.indexOf(".")-1))>=6;
}
else if (navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0
   && (navigator.userAgent.indexOf("Windows 95")>=0 || navigator.userAgent.indexOf("Windows 98")>=0 || navigator.userAgent.indexOf("Windows NT")>=0)) {
        document.write('<SCRIPT LANGUAGE=VBScript\> \n');
        document.write('on error resume next \n');
        document.write('plugin=( IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.6")))\n');
        document.write('</SCRIPT\> \n');
}
if ( plugin ) {

        document.write('<OBJECT classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"');
        document.write('  codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0"  ');
        document.write(' width="'+w+'" height="'+h+'" id="'+arg+'" align="middle">');
        document.write(' <PARAM NAME=movie VALUE="'+path+arg+'.swf"> <PARAM NAME=menu VALUE=false> <PARAM NAME=quality VALUE=high> <PARAM NAME=bgcolor VALUE=#FFFFFF>  ');
        document.write(' <param name="allowScriptAccess" value="sameDomain" />');
        document.write(' <EMBED src="'+path+arg+'.swf" menu=false quality=high bgcolor=#FFFFFF  ');
        document.write(' swLiveConnect=FALSE WIDTH='+w+' height='+h+' name="'+arg+'" align="middle" allowScriptAccess="sameDomain" ');
        document.write(' type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /> ');
        document.write(' </EMBED><br></OBJECT>');

}
else {
        document.write('<IMG SRC="'+path+img+'" WIDTH="'+w+'" HEIGHT="'+h+'" BORDER= "0" ALT = "" ><br>');
}
}
 
function trim(str) {
    var newstr = str.replace(/^\s*(.+?)\s*$/, "$1");
    if (newstr == " ") {
        return "";
    }
    return newstr;
}
function drop_spaces(str) {
    var newstr = trim(str); 
    return newstr.replace(/(\s)+/g, ""); 
}
function isValidEmail(email) {
    var template = /^[A-Za-z0-9](([_\.\-]?[a-zA-Z0-9]+)*)@([A-Za-z0-9]+)(([\.\-]?[a-zA-Z0-9]+)*)\.([A-Za-z])+$/;
    email = drop_spaces(email); 
    if (template.test(email)) {
        return true;
    }
    return false; 
}

function empty(mystr){  if (mystr === null  || mystr === "" || mystr === "0" || mystr === 0 || mystr === false || (typeof mystr === "undefined"))   return true; else  return false;    }

