
	function in_array(myArray,strSearch){
		for(i=0;i<myArray.length;i++){
			if(strSearch.toupper()==myArray(i).toupper()){
				return true;
			}
		}
		return false;
	}
	function arrayValue(myArray,Key){
		for(i in myArray){
			if(i==Key){
				return myArray[i];
			}
		}
		return false;
	}
	function createElements( args ) {  
		var el;
		if( typeof(args) == "string" ) {
			el = document.createTextNode(args);
		} else if ( typeof(args) == "object" ) {
			//For IE Fixing of Radio Button
			//IE BUG Detail: Radio button doesn't gets selected in newly created radio button
			//Reason: Name property doesn't apply after creating
			//Remedy: Create Element with name attributes
			if(args.type && args.type.toUpperCase()=='RADIO'){
				//IE can create element with name attributes other browsers do not
				try //Internet Explorer
				  {
					  el = document.createElement('<' + args.tag + ' type=\"RADIO\" name=\"' + args.name + ' value=\"' + args.value +'\" >');
					  //Remove the Type, name and value tag from the attributes list
					  
				  }
				catch(e)
				  {
				  try //Firefox, Mozilla, Opera, etc.
				    {
						el = document.createElement( args.tag );
				    }
				  catch(e) {alert(e.message)}
				  }
			}else{
				el = document.createElement( args.tag );				
			}
			if ( args.attributes ) {
				for ( i in args.attributes ) {
					el.setAttribute(i, args.attributes[i]);
				}
			}
			if ( args.style ) {
				for ( i in args.style ) {
					el.style[i] = args.style[i];
				}
			}
			if ( args.children ) {
				for ( var i = 0; i < args.children.length; i++ ) {
					el.appendChild( createElements( args.children[i] ) );
				}
			}
		}
		return el;
	}
   function get(myForm,URL) {
   	  obj=myForm;
      var getstr = "?";
      for (i=0; i<obj.childNodes.length; i++) {
         if (obj.childNodes[i].tagName == "INPUT") {
            if (obj.childNodes[i].type == "text") {
               getstr += obj.childNodes[i].name + "=" + obj.childNodes[i].value + "&";
            }
            if (obj.childNodes[i].type == "checkbox") {
               if (obj.childNodes[i].checked) {
                  getstr += obj.childNodes[i].name + "=" + obj.childNodes[i].value + "&";
               } else {
                  getstr += obj.childNodes[i].name + "=&";
               }
            }
            if (obj.childNodes[i].type == "radio") {
               if (obj.childNodes[i].checked) {
                  getstr += obj.childNodes[i].name + "=" + obj.childNodes[i].value + "&";
               }
            }
         }
         if (obj.childNodes[i].tagName == "SELECT") {
            var sel = obj.childNodes[i];
            getstr += sel.name + "=" + sel.options[sel.selectedIndex].value + "&";
         }
      }
      makeRequest(URL, getstr);
    }
	function DrawElement(TargetElement, SourceFile)
	{
		
		
	}

	function MM_findObj(n, d) { //v4.01
	  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
	    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
	  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
	  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
	  if(!x && d.getElementById) x=d.getElementById(n); return x;
	}
	
	function MM_validateForm() { //v4.0
	  var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
	  for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args[i]);
	    if (val) { nm=val.name; if ((val=val.value)!="") {
	      if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
	        if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n';
	      } else if (test!='R') { num = parseFloat(val);
	        if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
	        if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
	          min=test.substring(8,p); max=test.substring(p+1);
	          if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
	    } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; }
	  } if (errors) alert('The following error(s) occurred:\n'+errors);
	  document.MM_returnValue = (errors == '');
	}
	
function modalWin(url, winname, prop)
{
	if(winname == null)
		winname = "";
	if(prop == null)
		prop = "";
	else if(prop != "")
		prop = prop + ",";
		
	if (window.showModalDialog)
	{
		prop = prop.replace(/=/gi,":");
		prop = prop.replace(/,/gi,";");
		prop = prop.replace(/height/i,'dialogHeight');
		prop = prop.replace(/width/i,'dialogWidth');
		prop = prop.replace(/top/i,'dialogTop');
		prop = prop.replace(/left/i,'dialogLeft');
		window.showModalDialog(url,winname,prop);
	} else {
		window.open(url,winname,prop + 'modal=yes');
	}

} 
	function trim(s)
	{
		return s.replace(/^\s+|\s+$/, '');
	}

	function validateEmail() 
	{
		var YrMail=document.getElementById('yr_mail').value;
		var FrnMail=document.getElementById('frn_mail').value;
		var YrName=document.getElementById('yr_name').value;
		var FrnName=document.getElementById('frn_name').value;
		if(YrName == "")
		{
			alert ('Enter Your Name');
			return false;
		}
		else if(YrMail =="" || FrnMail=="")
		{
			alert("Enter Mail Address");
			return false;
		}
		else if(FrnName == "")
		{
			alert ('Enter Friend Name');
			return false;
		}
		else if ((YrMail!="" || FrnMail!="") ||((YrMail!="" && FrnMail!="")))
		{
		       var tfld1 = trim(YrMail);
		       var tfld2 = trim(FrnMail);
		       var emailFilter = /^[^@]+@[^@.]+\.[^@]*\w\w$/ ;
		       var illegalChars= /[\(\)\<\>\,\;\:\\\"\[\]]/ ;
			if ((!emailFilter.test(tfld1)) || (!emailFilter.test(tfld2)))
			{              
				alert("Please enter a valid email address");
				return false;
			}else if(emailFld.value.match(illegalChars))
			{
				alert("The email address contains illegal characters");
				return false;
			}else{
				return true;
			} 
		}
	}
function highlight(id)
{
	alert('id=='+id);
	document.getElementById(id).style.fontWeight='Bold';
}  


