//############# MY FORM FUNCTION #################################################
	function myform(frmName) {
		if(!document.getElementById(frmName)) return ;
		var id=document.getElementById(frmName);
		id.onsubmit=function(){
			return callMyform(this);
		}
	}

	function callMyform(formfields) {
		var returnval=true;
		for(var i=0; i<formfields.elements.length; i++) {
			//var re = new RegExp("[^a-zA-Z0-9?\~\(\)/_. ]","i");
			var element=formfields.elements[i];
			if(element.className=="emailrequired") {
				if(!(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(element.value))) {
					alert(" Please Enter the Valid "+element.title);
					element.focus();
					returnval=false;
					break;
				}
			} else if(element.className=="mandatory" ) {
			if(element.value.length > 1 && element.type =="text") {
					/*if(Trim(element.value)){
						alert(" Please remove the White spaces from " + element.title);
						element.focus();
						returnval=false;
					    break;
					}*/
					/*if(re.test(element.value)){
						alert(" Please Enter the Valid " + element.title);
						element.focus();
						returnval=false;
					    break;
					}*/
				}
				if(element.value.length < 1) {
					alert(" Please Enter the " + element.title);
					element.focus();
					returnval=false;
				    break;
			  }
		} else if(element.className=="selectcombo") {
				if(element.value=="-1") {
					alert(" Please Select the " + element.title);
					element.focus();
					returnval=false;
					break;
				}
			} else if(element.className=="notanumber") {
				if(element.value.length < 1 || isNaN(element.value)) {
					alert(" Please Enter the " + element.title + " in Digits ");
					element.focus();
					returnval=false;
					break;
				}
			} else if(element.className=="uploadimagescript") {
				// START IMAGE CHECK
					extArray = new Array(".jpg", ".gif");
					allowSubmit = false;
					file=element.value;
					if (!file) { return; }
					while (file.indexOf("\\") != -1)
						file = file.slice(file.indexOf("\\") + 1);
						ext = file.slice(file.indexOf(".")).toLowerCase();
						for (var i = 0; i < extArray.length; i++) {
							if (extArray[i] == ext) { allowSubmit = true; break; }
						}
						if (allowSubmit) {
							return true;
						} else {
							alert("Please Upload the Files with these Extensions Only:\n  "
							+ (extArray.join("  ")) + "\nPlease Select a New File to Upload and Submit Again.");
							element.focus();
							return false;
						}
				// END IMAGE CHECK
			} else if(element.className=="uploadfilescript") {
				// START IMAGE CHECK
					extArray = new Array(".jpg", ".gif", ".doc", ".pdf");
					allowSubmit = false;
					file=element.value;
					if (!file) { return; }
					while (file.indexOf("\\") != -1)
						file = file.slice(file.indexOf("\\") + 1);
						ext = file.slice(file.indexOf(".")).toLowerCase();
						for (var i = 0; i < extArray.length; i++) {
							if (extArray[i] == ext) { allowSubmit = true; break; }
						}
						if (allowSubmit) {
							return true;
						} else {
							alert("Please Upload the Files with these Extensions Only:\n  "
							+ (extArray.join("  ")) + "\nPlease Select a New File to Upload and Submit Again.");
							element.focus();
							return false;
						}
				// END IMAGE CHECK
			}
		}
		return returnval;
	}
//############# MY FORM FUNCTION ENDS #################################################

//############# FUNCTIONS #############################################################
//############# FUNCTIONS END ########################################################

//############# BOOKMARK #############################################################
	function bookmarksite(title, url) {
		if (document.all)
			window.external.AddFavorite(url, title);
		else if (window.sidebar)
			window.sidebar.addPanel(title, url, "")
	}
//############# BOOKMARK END #########################################################
//############# Remove White Spaces #########################################################

	function Trim(str) {
		if(str.charAt(0) == (" ") || str.charAt(str.length-1) == " ") { 
		   return true;
		  //str = str.substring(1);
		}
		// while(str.charAt(str.length-1) == " " )
		// {  //str = str.substring(0,str.length-1);
		//	return str;
		// }
	  return false;
	}
//############# End Remove White Spaces #########################################################


//#################### News Rotate ########################################

	
	
	function scrollerObj(name,initH,initW,heightB,widthB,content,initBg,Bg,speed,initFl){
	//*data*//
	this.name=name;this.initH=initH;this.initW=initW;this.heightB=heightB;
	this.widthB=widthB;this.content=content;this.initBg=initBg;
	this.Bg=Bg;this.iniFl=initFl;this.speed=parseInt(speed,10);
	this.timer=name+"Timer";
	//*methods*//
	this.getElement=getElement;this.createLayer=createLayer;
	this.scrollLayer=scrollLayer;this.scrollLoop=scrollLoop;
	//*initiate methods*//
	this.createLayer();this.getElement();this.scrollLayer();}
	//*call this method to stop scrolling*//
	function scrollLoop(s){this.speed=s;}
	function scrollLayer(){
	if(parseInt(this.elem.style.top,10)>0){
	this.elem.style.top=parseInt(this.elem.style.top,10)-this.speed+'px';
	} else {this.elem.style.top=this.initH+'px';}}
	
	function getElement(){this.elem=document.getElementById(this.name);}
	function createLayer(){
	document.write('<div id="layer'+this.name+'" style="position:relative;overflowdden;float:');
	document.write(this.initFl+';background-color:#'+this.initBg+';border:0px solid black;width:');
	document.write(this.initW+'px;height:'+this.initH+'px;" onmouseover="');
	document.write(this.name+'.scrollLoop(0)" onmouseout="'+this.name+'.scrollLoop(');
	document.write(this.speed+')">');
	document.write('<div id="'+this.name+'" style="position:absolute;top:');
	document.write(this.initH+'px;left:0px;border:0px solid black;width:');
	document.write(this.widthB+'px;height:'+this.heightB+'px;background-color:#');
	document.write(this.Bg+'">');
	document.write(this.content);
	document.write('<\/div><\/div>');
	if(this.scrollLayer){this.timer=setInterval(this.name+'.scrollLayer()','30');}
	}



