function move0() {
window.moveTo(0, 0)
}

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 checkemail(email) {
    if (email.length < 11 || email.indexOf("@")==-1 || email.indexOf(".")==-1 || email.indexOf("!")!=-1 || email.indexOf("..")!=-1 || email.indexOf(".")==0 || email.indexOf(".")==email.length|| email.indexOf("test")!=-1 || email.indexOf("hjkl")!=-1 || email.indexOf("yuio")!=-1 || email.indexOf("zxcv")!=-1 || email.indexOf("asdf")!=-1 || email.indexOf("qwer")!=-1)
		return false;
    else {
		var pos;
		pos = email.indexOf("@");
		var mailbox=email.substring(0,pos);
		var domainname=email.substring(pos+1,email.length);
		var mailboxlast=mailbox.substring(mailbox.length-1,mailbox.length);
		var domainfirst=domainname.substring(0,1);
		var lastdigit=email.substring(email.length-1,email.length);
		var firstdigit=email.substring(0,1)
		if (mailbox.indexOf("-")==-1 && domainname.indexOf("_")==-1 && domainname.indexOf("@")==-1 && lastdigit.indexOf(".")==-1 && lastdigit.indexOf("-")==-1 && firstdigit.indexOf(".")==-1 && firstdigit.indexOf("_")==-1 && mailboxlast.indexOf(".")==-1 && mailboxlast.indexOf("_")==-1 && domainfirst.indexOf(".")==-1 && domainfirst.indexOf("-")==-1)
			return true;
		else
			return false;
    }
}

String.prototype.trim = function()
{
  return( this.replace(/^\s*([\s\S]*\S+)\s*$|^\s*$/,'$1') );   
}

function checktags(chkstr) {
		if (chkstr.indexOf("i>")==-1 && chkstr.indexOf("b>")==-1 && chkstr.indexOf("p>")==-1 && chkstr.indexOf("h1>")==-1 && chkstr.indexOf("h2>")==-1 && chkstr.indexOf("h3>")==-1 && chkstr.indexOf("h4>")==-1 && chkstr.indexOf("h5>")==-1 && chkstr.indexOf("h6>")==-1 && chkstr.indexOf("body>")==-1 && chkstr.indexOf("html>")==-1 && chkstr.indexOf("br>")==-1 && chkstr.indexOf("hr>")==-1 && chkstr.indexOf("font>")==-1 && chkstr.indexOf("'")==-1 && chkstr.indexOf("script>")==-1 && chkstr.indexOf("-->>")==-1 && chkstr.indexOf("<!--")==-1 && chkstr.indexOf("form>")==-1 && chkstr.indexOf("div>")==-1 && chkstr.indexOf("u>")==-1 && chkstr.indexOf("ol>")==-1 && chkstr.indexOf("ul>")==-1 && chkstr.indexOf("select>")==-1 && chkstr.indexOf("<input")==-1 && chkstr.indexOf("location.href")==-1 && chkstr.indexOf("response.redirect")==-1 && chkstr.indexOf("<%")==-1 && chkstr.indexOf("%>")==-1)
		{
			return true;
		}
		else
		{
			return false;
		}

}

function checkname(name) {
    if (name.indexOf("wedsite")!=-1 || name.indexOf("website")!=-1 || name.indexOf(".info")!=-1 || name.indexOf(".biz")!=-1 || name.indexOf(".or")!=-1 || name.indexOf(".net")!=-1 || name.indexOf(".co")!=-1 || name.indexOf("www")!=-1 || name.indexOf("@")!=-1 || name.indexOf("neowed")!=-1 || name.indexOf("menaravisi")!=-1 || name.indexOf("weddingku")!=-1 || name.indexOf("test")!=-1 || name.indexOf("hjkl")!=-1 || name.indexOf("yuio")!=-1 || name.indexOf("zxcv")!=-1 || name.indexOf("asdf")!=-1 || name.indexOf("qwer")!=-1)
		return false;
	else
		return true;
}

function resizeToContent() {
	var isMSIE = (navigator.appName == "Microsoft Internet Explorer");
	var isOpera = (navigator.userAgent.indexOf("Opera") != -1);

	if (isOpera)
		return;

	if (isMSIE) {
		try { window.resizeTo(10, 10); } catch (e) {}
		var elm = document.body;
		var width = elm.offsetWidth;
		var height = elm.offsetHeight;
		var dx = (elm.scrollWidth - width) + 4;
		var dy = elm.scrollHeight - height;
		try { window.resizeBy(dx, dy); } catch (e) {}
	} else {
		window.scrollBy(1000, 1000);
		if (window.scrollX > 0 || window.scrollY > 0) {
			window.resizeBy(window.innerWidth * 2, window.innerHeight * 2);
			window.sizeToContent();
			window.scrollTo(0, 0);
			var x = parseInt(screen.width / 2.0) - (window.outerWidth / 2.0);
			var y = parseInt(screen.height / 2.0) - (window.outerHeight / 2.0);
			window.moveTo(x, y);
		}
	}
}


/***********************************************
* Drop Down/ Overlapping Content- © Dynamic Drive (www.dynamicdrive.com)
* This notice must stay intact for legal use.
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/

function getposOffset(overlay, offsettype){
var totaloffset=(offsettype=="left")? overlay.offsetLeft : overlay.offsetTop;
var parentEl=overlay.offsetParent;
while (parentEl!=null){
totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
parentEl=parentEl.offsetParent;
}
return totaloffset;
}

function overlay(curobj, subobjstr, opt_position){
if (document.getElementById){
var subobj=document.getElementById(subobjstr)
subobj.style.display=(subobj.style.display!="block")? "block" : "none"
var xpos=getposOffset(curobj, "left")+((typeof opt_position!="undefined" && opt_position.indexOf("right")!=-1)? -(subobj.offsetWidth-curobj.offsetWidth) : 0) 
var ypos=getposOffset(curobj, "top")+((typeof opt_position!="undefined" && opt_position.indexOf("bottom")!=-1)? curobj.offsetHeight : 0)
subobj.style.left=xpos+"px"
subobj.style.top=ypos+"px"
return false
}
else
return true
}

function overlayclose(subobj){
document.getElementById(subobj).style.display="none"
}

function validate_contactus() {
document.form1.firstname.value=document.form1.firstname.value.trim();
document.form1.companyname.value=document.form1.companyname.value.trim();
document.form1.occupation.value=document.form1.occupation.value.trim();
document.form1.address.value=document.form1.address.value.trim();
document.form1.city.value=document.form1.city.value.trim();
document.form1.homephone.value=document.form1.homephone.value.trim();
document.form1.email.value=document.form1.email.value.trim();
document.form1.comment.value=document.form1.comment.value.trim();

//firstname
if (document.form1.firstname.value.trim() == "") {
	alert("Please Fill Out Your Name!");
	document.form1.firstname.focus();
	return false;
}	
//companyname
if (document.form1.companyname.value == "") {
	alert("Please Fill Out Your Company Name!");
	document.form1.companyname.focus();
	return false;
}
//occupation
if (document.form1.occupation.value == "") {
	alert("Please Fill Out Your Position!");
	document.form1.occupation.focus();
	return false;
}
//address
if (document.form1.address.value == "") {
	alert("Please Fill Out Your Address!");
	document.form1.address.focus();
	return false;
}	
//phone
if (document.form1.homephone.value == "") {
	alert("Please Fill Out Your Phone!");
	document.form1.homephone.focus();
	return false;
}
//city
if (document.form1.city.value == "") {
	alert("Please Fill Out Your Location!");
	document.form1.city.focus();
	return false;
}
//email
if (document.form1.email.value == "") {
	alert("Please Fill Out Your Email!");
	document.form1.email.focus();
	return false;
}	
if (document.form1.email.value != "" && !checkemail(document.form1.email.value)){
	alert("Email Is Not Valid");
	document.form1.email.focus();
	return false;
}			 
//content
if (document.form1.comment.value == "") {
	alert("Please Fill Out Your Notes!");
	document.form1.comment.focus();
	return false;
}	
return true;
}

function validate_application() {
document.form1.firstname.value=document.form1.firstname.value.trim();
document.form1.email.value=document.form1.email.value.trim();
document.form1.filesubmit.value=document.form1.filesubmit.value.trim();

//firstname
if (document.form1.firstname.value.trim() == "") {
	alert("Please Fill Out Your Name!");
	document.form1.firstname.focus();
	return false;
}	
//email
if (document.form1.email.value == "") {
	alert("Please Fill Out Your Email!");
	document.form1.email.focus();
	return false;
}	
if (document.form1.email.value != "" && !checkemail(document.form1.email.value)){
	alert("Email Is Not Valid");
	document.form1.email.focus();
	return false;
}			 
//file
if (document.form1.filesubmit.value == "") {
	alert("Please Submit Your Resume Using the Template Above!");
	document.form1.filesubmit.focus();
	return false;
}	
return true;
}

function validate_consult() {
document.form1.asksubject.value=document.form1.asksubject.value.trim();
document.form1.asknotes.value=document.form1.asknotes.value.trim();
document.form1.askfile.value=document.form1.askfile.value.trim();

//subject
if (document.form1.asksubject.value.trim() == "") {
	alert("Please Fill Out Your Subject!");
	document.form1.asksubject.focus();
	return false;
}	
//notes
if (document.form1.asknotes.value == "") {
	alert("Please Fill Out Your Notes!");
	document.form1.asknotes.focus();
	return false;
}	
			 
//file
//if (document.form1.askfile.value == "") {
	//alert("Please Submit Your Resume Using the Template Above!");
	//document.form1.askfile.focus();
	//return false;
//}	
return true;
}

function validate_testimonial() {
document.form1.title.value=document.form1.title.value.trim();
document.form1.description.value=document.form1.description.value.trim();
document.form1.content.value=document.form1.content.value.trim();

//name
if (document.form1.title.value.trim() == "") {
	alert("Please Fill Out Your Name!");
	document.form1.title.focus();
	return false;
}	
//position
if (document.form1.description.value == "") {
	alert("Please Fill Out Your Position!");
	document.form1.description.focus();
	return false;
}	
	
//content
if (document.form1.content.value == "") {
	alert("Please Fill Out Your Testimonial!");
	document.form1.content.focus();
	return false;
}	
//file
//if (document.form1.askfile.value == "") {
	//alert("Please Submit Your Resume Using the Template Above!");
	//document.form1.askfile.focus();
	//return false;
//}	
return true;
}

function validate_register() {
document.form1.firstname.value=document.form1.firstname.value.trim();
document.form1.companyname.value=document.form1.companyname.value.trim();
document.form1.occupation.value=document.form1.occupation.value.trim();
document.form1.address.value=document.form1.address.value.trim();
document.form1.city.value=document.form1.city.value.trim();
document.form1.homephone.value=document.form1.homephone.value.trim();
document.form1.email.value=document.form1.email.value.trim();
document.form1.comment.value=document.form1.comment.value.trim();
			
//schedule 
if (document.form1.schedule.value == "") {
	alert("Please Select Program Schedule!");
	return false;
}	
//firstname
if (document.form1.firstname.value.trim() == "") {
	alert("Please Fill Out Your Name!");
	document.form1.firstname.focus();
	return false;
}	
//companyname
if (document.form1.companyname.value == "") {
	alert("Please Fill Out Your Company Name!");
	document.form1.companyname.focus();
	return false;
}
//occupation
if (document.form1.occupation.value == "") {
	alert("Please Fill Out Your Position!");
	document.form1.occupation.focus();
	return false;
}
//address
if (document.form1.address.value == "") {
	alert("Please Fill Out Your Address!");
	document.form1.address.focus();
	return false;
}	
//phone
if (document.form1.homephone.value == "") {
	alert("Please Fill Out Your Phone!");
	document.form1.homephone.focus();
	return false;
}
//city
if (document.form1.city.value == "") {
	alert("Please Fill Out Your Location!");
	document.form1.city.focus();
	return false;
}
//email
if (document.form1.email.value == "") {
	alert("Please Fill Out Your Email!");
	document.form1.email.focus();
	return false;
}	
if (document.form1.email.value != "" && !checkemail(document.form1.email.value)){
	alert("Email Is Not Valid");
	document.form1.email.focus();
	return false;
}			 
//content
if (document.form1.comment.value == "") {
	alert("Please Fill Out Your Notes!");
	document.form1.comment.focus();
	return false;
}	
return true;
}

