function changemail(obj,idname,txt){
if (document.getElementById(idname).style.visibility!="visible")
{
	document.getElementById(idname).style.visibility="visible";
	document.getElementById(idname).style.position="relative";
	obj.innerHTML=txt+" &laquo;";
}else
{	document.getElementById(idname).style.visibility="hidden";
	document.getElementById(idname).style.position="absolute";
	obj.innerHTML=txt+" &raquo;";

}

}

function CopyCode(idname)
{      
 
	var code;

		code = document.getElementById(idname).value;

       	if (code.length>0)
       	{
 		if (window.clipboardData) 
   		{
           		window.clipboardData.setData("Text", code);
       			alert("Your Video Code has been copied to the ClipBoard! \n\n Simply PASTE (Ctrl+V) this into your html document.");
		} else{

				document.getElementById(idname).focus();
				document.getElementById(idname).select();

      			alert("Use the right mouse button over the code & select COPY!  Then PASTE into your HTML document.");
                  }
        }
        else
        	alert("You do not have anything to Copy!");

}
  function validateEmailPageForm(form) {
    var frm = form;
    var msg = "";
    
    if (frm.to.value == "") {
      alert("Please provide Send to Email Address.");
      frm.to.focus();
      return false;
    }
    
    if (!checkEmail(frm.to)) {
      alert("Please provide valid Send to Email Address.");
      frm.to.focus();
      return false;
    }
    
    if (frm.from.value == "") {
      alert("Please provide Your Email Address.");
      frm.from.focus();
      return false;
    }
    
    if (!checkEmail(frm.from)) {
      alert("Please provide your valid Email Address.");
      frm.from.focus();
      return false;
    }
    
    if (frm.subject.value == "") {
      alert("Please provide Subject.");
      frm.subject.focus();
      return false;
    }
    
    return true;
  }
  
  function isStringValid(w) {
    x1 = /^[a-z\d]{2,15}$/i // only alphanumerics, and length 6-10
    x2 = /[a-z]/i           // a letter present
    x3 = /\d/               // a digit present
    OK = x1.test(w) && x2.test(w) && x3.test(w)
    return OK;
  }
  
  function checkEmail(fld)
  {
  	if(fld.value == ""){
  		return true;
  	}
   	if (fld.value.length = 0) return false;
  	str = fld.value;	
  	re = /(^[A-Za-z0-9_])([A-Za-z0-9_.-]*)@((([A-Za-z0-9_-]{2,})\.){1,3})(([A-Za-z]{2,3})$)/;
  	if ( re.test(str) ) {
  		return true;
  	} else {
  		return false;
  	}
  }
 function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

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_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
function get_cdateline(id){
		d = new Array("Sunday",	"Monday","Tuesday","Wednesday","Thursday","Friday","Saturday");
		m = new Array("January","February",	"March","April","May","June","July","August","September","October","November","December");
		today = new Date();	day = today.getDate();year = today.getYear();
		if (year < 2000)year +=1900;end = "th";
		if (day==1 || day==21 || day==31) end="st";
		if (day==2 || day==22) end="nd";
		if (day==3 || day==23) end="rd";
		day+=end;
		$(id).innerHTML=d[today.getDay()]+", "+m[today.getMonth()]+" "+day+", " + year;
}