// coded by turtles 2007
//
// http://www.turtle-media.com/
//
// all rights reserved
//
var root
root = 'http://www.turtle-media.com/clients/WHAT IS THE DOMAIN/'
//
////////////////////////////////////////////////////////////////////
// get  and set cookie script
function getC(c_name){ 
if (document.cookie.length>0){c_start=document.cookie.indexOf(c_name + "=")
if (c_start!=-1){ c_start=c_start + c_name.length+1; c_end=document.cookie.indexOf(";",c_start)
if (c_end==-1) {c_end=document.cookie.length}; return unescape(document.cookie.substring(c_start,c_end))}} return ""}
// setPermCookie script
function setC(c_name, c_value){document.cookie =  c_name + '=' + c_value + '; expires=Thu, 2 Aug 2040 20:47:11 UTC; path=/'}
////////////////////////////////////////////////////////////////////
//showhide
function show(divid){document.getElementById(divid).style.display = "block";}
function showinline(divid){document.getElementById(divid).style.display = "inline"}
function hide(divid){document.getElementById(divid).style.display = "none"}
////////////////////////////////////////////////////////////////////
function redirect(url){	document.location = url}
function conf(url){if(confirm("Are you sure?")){redirect(url)}}
////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////
/**
 * DHTML email validation script. Courtesy of SmartWebby.com (http://www.smartwebby.com/dhtml/)
 */

function echeck(str) {

		var at="@"
		var dot="."
		var lat=str.indexOf(at)
		var lstr=str.length
		var ldot=str.indexOf(dot)
		if (str.indexOf(at)==-1){
		   alert("Invalid E-mail Address")
		   return false
		}

		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		   alert("Invalid E-mail Address")
		   return false
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		    alert("Invalid E-mail Address")
		    return false
		}

		 if (str.indexOf(at,(lat+1))!=-1){
		    alert("Invalid E-mail Address")
		    return false
		 }

		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		    alert("Invalid E-mail Address")
		    return false
		 }

		 if (str.indexOf(dot,(lat+2))==-1){
		    alert("Invalid E-mail Address")
		    return false
		 }
		
		 if (str.indexOf(" ")!=-1){
		    alert("Invalid E-mail Address")
		    return false
		 }

 		 return true					
	}

function ValidateForm(){
	var emailID=document.contactfrm.email
	var pnameID=document.contactfrm.pname
	
	if ((pnameID.value==null)||(pnameID.value=="")){
		alert("Please Enter your Name")
		pnameID.focus()
		return false
	}
	
	if ((emailID.value==null)||(emailID.value=="")){
		alert("Please Enter your Email Address")
		emailID.focus()
		return false
	}
	
	if (echeck(emailID.value)==false){
		emailID.value=""
		emailID.focus()
		return false
	}
	return true
 }

