/**********************************************************************************/
var newwindow;

var sc_project=3162830; 
var sc_invisible=0; 
var sc_partition=24; 
var sc_security="8205e0e6"; 


function popimage(url)
{
	newwindow=window.open(url,'ImageDisplay','height=600,width=600,left=0,top=0,resizable=yes,scrollbars=yes');
	if (window.focus) {newwindow.focus()}
}
function OpenWin(url,winName,w,h,other)
	{
	var acc = "width=" + w + ",height=" + h + "," + other;
	window.open(url,winName,acc);
	}

function openchild()
	{
	var dof="val";
    document.form1.action="realtime.php?val="+dof;
    document.form1.submit();
	}
	
	
function event_validation1()

{
	
	

	if(document.frm_addevent.txtHeading.value=="")

	{

		alert("Please enter the Event Title");

		document.frm_addevent.txtHeading.focus();

		return false;

	}

	if(document.frm_addevent.txtDate.value=="")

	{

		alert("Please enter the Event Date");

		document.frm_addevent.txtDate.focus();

		return false;

	}

	if(document.frm_addevent.txtHour.value=="Select")

	{

		alert("Please Choose the Hour");

		document.frm_addevent.txtHour.focus();

		return false;

	}

	if(document.frm_addevent.txtMinute.value=="Select")

	{

		alert("Please Choose the Minute");

		document.frm_addevent.txtMinute.focus();

		return false;

	}

	if(document.frm_addevent.txtLocation.value=="")

	{

		alert("Please enter the Location");

		document.frm_addevent.txtLocation.focus();

		return false;

	}



	if(document.frm_addevent.txtLevel.value=="Select")

	{

		alert("Please Choose the priority level");

		document.frm_addevent.txtLevel.focus();

		return false;

	}
	




}
	
	
function sortingresults(){
	
	var catname=document.form1.comid.value;
	var dof="cusad";
		if (catname=="All")
			{
				window.location.href="realtime.php?sortmode="+document.form1.sortmode.value;
			}
		else
			{
				window.location.href="realtime.php?li="+document.form1.comid.value+"&sortmode="+document.form1.sortmode.value;
			}
	
	
}

	function openchilddel(screen1,val,li,searchs,sortmode)
	{
		//alert(sortmode);
	var dof="delete";
    document.form1.action="realtime.php?delflag="+dof+"&screen="+screen1+"&val="+val+"&li="+li+"&search="+searchs+"&sortmode="+sortmode;
	//alert("realtime.php?delflag="+dof+"&screen="+screen1+"&val="+val+"&li="+li+"&search="+searchs+"&sortmode="+sortmode) ;
    document.form1.submit();
	}
function confirmMsg(msg){
	if(!confirm(msg)){
		return false;

	} else {
		return true;

	}
}
//Right Click Disable
<!--

//Disable right mouse click Script
//By Maximus (maximus@nsimail.com) w/ mods by DynamicDrive
//For full source code, visit http://www.dynamicdrive.com

var message="Right click is disabled!";

///////////////////////////////////
function clickIE4(){
if (event.button==2){
alert(message);
return false;
}
}

function clickNS4(e){
if (document.layers||document.getElementById&&!document.all){
if (e.which==2||e.which==3){
alert(message);
return false;
}
}
}

if (document.layers){
document.captureEvents(Event.MOUSEDOWN);
document.onmousedown=clickNS4;
}
else if (document.all&&!document.getElementById){
document.onmousedown=clickIE4;
}

document.oncontextmenu=new Function("alert(message);return false")

// --> 
function changecat()
	{
	var catname=document.form1.comid.value;
	var dof="cusad";
		if (catname=="All")
			{
				window.location.href="realtime.php";
			}
		else
			{
				window.location.href="realtime.php?li="+document.form1.comid.value;
			}
	}
	
//Function Login validation
function login_validate(){

		 if (document.login.txtuser.value == "") 
		{
				alert ("Login name is empty");
				document.login.txtuser.focus();
				return false;
		}
		if (document.login.txtpass.value == "") 
		{
				alert ("Password is empty");
				document.login.txtpass.focus();
				return false;
		}
}

function fpassword_validate(){
	if (document.frm_fpassword.username.value == "") 
		{
				alert ("User Name is empty");
				document.frm_fpassword.username.focus();
				return false;
		}
	if (!validateEmail(document.frm_fpassword.emailid.value,1,1)) 
		{
				document.frm_fpassword.emailid.focus();
				return false;
		}
}
function support_validate()
{
	if (document.support.name.value == "") 
		{
				alert ("Enter The Name");
				document.support.name.focus();
				return false;
		}
	if (!validateEmail(document.support.email.value,1,1)) 
		{
				document.support.email.focus();
				return false;
		}
	if (document.support.question.value == "") 
		{
				alert ("Please enter the Question field");
				document.support.question.focus();
				return false;
		}
return true;
}

//Function Member Validation in the front panel
function adduser_validation(){
/*if (document.adduser.member_type.value == "") {
				alert ("Please select the membership type");
				document.adduser.member_type.focus();
				return false;
		}*/
if (document.adduser.firstname.value == "") {
				alert ("Please enter the first name");
				document.adduser.firstname.focus();
				return false;
		}
if (document.adduser.lastname.value == "") {
				alert ("Please enter the last name");
				document.adduser.lastname.focus();
				return false;
		}
		
	phone=document.adduser.phone;
		if (checkInternationalPhone(phone.value)==false){
			alert("Please Enter a Valid Phone Number")
			phone.value=""
			phone.focus()
			return false
			}
			if (!validateEmail(document.adduser.email.value,1,1)) 
		{
				document.adduser.email.focus();
				return false;
		}

if (document.adduser.address.value == "") {
				alert ("Please enter the address line1");
				document.adduser.address.focus();
				return false;
		}
if (document.adduser.city.value == "") {
				alert ("Please enter the city");
				document.adduser.city.focus();
				return false;
		}
if (document.adduser.state.value == "") {
				alert ("Please enter the state");
				document.adduser.state.focus();
				return false;
		}
if (document.adduser.country.value == "Choose") {
				alert ("Please select the country");
				document.adduser.country.focus();
				return false;
		}
if (document.adduser.zipcode.value == "") {
				alert ("Please enter the zipcode");
				document.adduser.zipcode.focus();
				return false;
		}
if (document.adduser.ibpuserid.value == "") {
				alert ("Please enter the IBPuserId ");
				document.adduser.ibpuserid.focus();
				return false;
		}		
		
	/*phone=document.adduser.phone;
		if (checkInternationalPhone(phone.value)==false){
			alert("Please Enter a Valid Phone Number")
			phone.value=""
			phone.focus()
			return false
			}*/

/*if (!validateEmail(document.adduser.email.value,1,1)) 
		{
				document.adduser.email.focus();
				return false;
		}
*/
if (document.adduser.username.value == "") {
				alert ("Please enter the user name");
				document.adduser.username.focus();
				return false;
		}
var username = document.adduser.username.value;
var entereduser = username.toUpperCase();
 if(parseInt(username.length) < 6 || entereduser == "TEMPLATE"  || entereduser == "CAPTUREPAGES" || entereduser == "IMAGES"  || entereduser == "ADMIN" || entereduser == "SCRIPT" || entereduser == "CSS" || entereduser == "INCLUDE" || entereduser == "TEMPLATEIMAGES" ||  entereduser == "FILES_UPLOADED"){
	alert ("Please select the user name of atleat 6 characters in length\nPleae be specific about your login name\nPlease avoid the reserved keywords like template,admin etc...");
	document.adduser.username.focus();
	return false; 
 }
if(username.indexOf("*") >= 0 || username.indexOf("\\") >= 0 || username.indexOf("/") >= 0  || username.indexOf("\"") >= 0 || username.indexOf("?") >= 0  || username.indexOf(":") >= 0 || username.indexOf("<") >= 0  || username.indexOf(">") >= 0  || username.indexOf("|") >= 0 ) {
			alert("Login name has invalid charactes such as /,\\,*,?,:,<,>,|,\"");
			document.adduser.username.focus();
			return false;
}
if (document.adduser.password.value == "") {
				alert ("Please enter the password");
				document.adduser.password.focus();
				return false;
}

if (document.adduser.password2.value == "") {
				alert ("Please enter the Confirm password");
				document.adduser.password2.focus();
				return false;
}

if (document.adduser.password2.value != document.adduser.password.value) {
				alert ("Password and Confirm Password mismatch");
				document.adduser.password2.focus();
				return false;
}


/*if (!validateEmail(document.adduser.paypal.value,1,1)) 
		{
				document.adduser.paypal.focus();
				return false;
		}*/
}

//Function member validation

function member_validate(){
	if (document.addmember.txt_password.value == "") 
		{
				alert ("Password is empty");
				document.addmember.txt_password.focus();
				return false;
		}
	if (document.addmember.txt_password2.value == "") 
		{
				alert ("Confirm password is empty");
				document.addmember.txt_password2.focus();
				return false;
		}
	if (document.addmember.txt_password.value != document.addmember.txt_password2.value) 
		{
				alert ("Password mismatch");
				document.addmember.txt_password2.focus();
				return false;
		}
		
		if (document.addmember.txt_firstname.value == "") 
		{
				alert ("First name is empty");
				document.addmember.txt_firstname.focus();
				return false;
		}
		
		if (document.addmember.txt_lastname.value == "") 
		{
				alert ("Last name is empty");
				document.addmember.txt_lastname.focus();
				return false;
		}
		
			
		if (document.addmember.txt_address.value == "") 
		{
				alert ("Address line is empty");
				document.addmember.txt_address.focus();
				return false;
		}
		if (document.addmember.txt_city.value == "") 
		{
				alert ("City is empty");
				document.addmember.txt_city.focus();
				return false;
		}
		if (document.addmember.txt_state.value == "") 
		{
				alert ("State is empty");
				document.addmember.txt_state.focus();
				return false;
		}
		if (document.addmember.txt_zipcode.value == "") 
		{
				alert ("Zipcode is empty");
				document.addmember.txt_zipcode.focus();
				return false;
		}
		if (document.addmember.txt_country.value == "Choose") 
		{
				alert ("Please choose the country");
				document.addmember.txt_country.focus();
				return false;
		}
		if (document.addmember.txt_timezone.value == "Choose") 
		{
				alert ("Please choose your time zone");
				document.addmember.txt_timezone.focus();
				return false;
		}
			if (document.addmember.AffiliateUrl.value == "") 
		{
				alert ("Please Enter your Affiliate URL");
				document.addmember.AffiliateUrl.focus();
				return false;
		}
		
		
		
}


//Function member configuration validation
function memberconfig_validate(){

		if (document.addmember.txt_firstname.value == "") 
		{
				alert ("First name is empty");
				document.addmember.txt_firstname.focus();
				return false;
		}
		
		if (document.addmember.txt_lastname.value == "") 
		{
				alert ("Last name is empty");
				document.addmember.txt_lastname.focus();
				return false;
		}
	
		
		
		
	/*	if (document.addmember.sponsorname.value == "") 
		{
				alert ("Sponsor name is empty");
				document.addmember.sponsorname.focus();
				return false;
		}*/
		
		if (document.addmember.int_phonenumber.value == "") 
		{
				alert (" Phone is empty");
				document.addmember.int_phonenumber.focus();
				return false;
		}
		/*	if (document.addmember.fixcreditbizuser.value == '') 
		{
				alert("Please Enter the Fix Credit Biz User Name");
				document.addmember.fixcreditbizuser.focus();
				return false;
		}
			if (document.addmember.usgasuser.value == '') 
		{
				alert("Please Enter the US Gas User name");
				document.addmember.usgasuser.focus();
				return false;
		}*/
			if (document.addmember.ibuzzprouser.value == '') 
		{
				alert("Please Enter the IBuzz pro User name");
				document.addmember.ibuzzprouser.focus();
				return false;
		}
		
		
			/*if (document.addmember.ibuzzdomain.value == '') 
		{
				alert("Please Enter the IBuzz pro Domain name");
				document.addmember.ibuzzdomain.focus();
				return false;
		}*/
		
		
		phone=document.addmember.int_phonenumber;
		if (checkInternationalPhone(phone.value)==false){
			alert("Please Enter a Valid Phone Number")
			phone.value=""
			phone.focus()
			return false
			}
		
		if (!validateEmail(document.addmember.txt_email.value,1,1)) 
		{
				document.addmember.txt_email.focus();
				return false;
		}
		
			/*if (document.addmember.affurl.value == '') 
		{
				alert("Please Enter Affiliate Url ");
				document.addmember.affurl.focus();
				return false;
		}
	if (document.addmember.mainurl.value == '') 
		{
				alert("Please Enter DCF Inviter Code");
				document.addmember.mainurl.focus();
				return false;
		}*/
		
}


function changepwd_validate(){
	if (document.frm_changepwd.txt_oldpassword.value == "") 
		{
				alert ("Old Password is empty");
				document.frm_changepwd.txt_oldpassword.focus();
				return false;
		}
	if (document.frm_changepwd.txt_password.value == "") 
		{
				alert ("New Password is empty");
				document.frm_changepwd.txt_password.focus();
				return false;
		}
	if (document.frm_changepwd.txt_password2.value == "") 
		{
				alert ("Confirm new password is empty");
				document.frm_changepwd.txt_password2.focus();
				return false;
		}
	if (document.frm_changepwd.txt_password.value != document.frm_changepwd.txt_password2.value) 
		{
				alert ("Password mismatch");
				document.frm_changepwd.txt_password2.focus();
				return false;
		}
}

//Function tell a friend validation
function tellafriend_validate(){
	if (document.tellafriend.yourname.value == "") 
		{
				alert ("Please fill your name");
				document.tellafriend.yourname.focus();
				return false;
		}
		
	if (!validateEmail(document.tellafriend.youremail.value,1,1)) 
		{
				document.tellafriend.youremail.focus();
				return false;
		}
		
	if (document.tellafriend.friendname.value == "") 
		{
				alert ("Please fill your friend name");
				document.tellafriend.friendname.focus();
				return false;
		}
		
	if (!validateEmail(document.tellafriend.friendemail.value,1,1)) 
		{
				document.tellafriend.friendemail.focus();
				return false;
		}
		
	if (document.tellafriend.subject.value == "") 
		{
				alert ("Please fill the subject");
				document.tellafriend.subject.focus();
				return false;
		}
}

//Email Validation Script
function validateEmail(addr,man,db) {
	if (addr == '' && man) {
	   if (db) alert('Email address is mandatory');
	   return false;
	}
	var invalidChars = '\/\'\\ ";:?!()[]\{\}^|';
	for (i=0; i<invalidChars.length; i++) {
	   if (addr.indexOf(invalidChars.charAt(i),0) > -1) {
		  if (db) alert('Email address contains invalid characters');
		  return false;
	   }
	}
	for (i=0; i<addr.length; i++) {
	   if (addr.charCodeAt(i)>127) {
		  if (db) alert("Email address contains non ascii characters.");
		  return false;
	   }
	}

	var atPos = addr.indexOf('@',0);
	if (atPos == -1) {
	   if (db) alert('Email address must contain an @');
	   return false;
	}
	if (atPos == 0) {
	   if (db) alert('Email address must not start with @');
	   return false;
	}
	if (addr.indexOf('@', atPos + 1) > - 1) {
	   if (db) alert('Email address must contain only one @');
	   return false;
	}
	if (addr.indexOf('.', atPos) == -1) {
	   if (db) alert('Email address must contain a period in the domain name');
	   return false;
	}
	if (addr.indexOf('@.',0) != -1) {
	   if (db) alert('period must not immediately follow @ in email address');
	   return false;
	}
	if (addr.indexOf('.@',0) != -1){
	   if (db) alert('period must not immediately precede @ in email address');
	   return false;
	}
	if (addr.indexOf('..',0) != -1) {
	   if (db) alert('two periods must not be adjacent in email address');
	   return false;
	}
	var suffix = addr.substring(addr.lastIndexOf('.')+1);
	if (suffix.length != 2 && suffix != 'com' && suffix != 'net' && suffix != 'org' && suffix != 'edu' && suffix != 'int' && suffix != 'mil' && suffix != 'gov' & suffix != 'arpa' && suffix != 'biz' && suffix != 'aero' && suffix != 'name' && suffix != 'coop' && suffix != 'info' && suffix != 'pro' && suffix != 'museum') {
	   if (db) alert('invalid primary domain in email address');
	   return false;
	}
return true;
}

 //Function phone validation Script
// Declaring required variables
var digits = "0123456789";
// non-digit characters which are allowed in phone numbers
var phoneNumberDelimiters = "()- ";
// characters which are allowed in international phone numbers
// (a leading + is OK)
var validWorldPhoneChars = phoneNumberDelimiters + "+";
// Minimum no of digits in an international phone no.
var minDigitsInIPhoneNumber = 10;

function isInteger(s)
{   var i;
    for (i = 0; i < s.length; i++)
    {   
        // Check that current character is number.
        var c = s.charAt(i);
        if (((c < "0") || (c > "9"))) return false;
    }
    // All characters are numbers.
    return true;
}

function stripCharsInBag(s, bag)
{   var i;
    var returnString = "";
    // Search through string's characters one by one.
    // If character is not in bag, append to returnString.
    for (i = 0; i < s.length; i++)
    {   
        // Check that current character isn't whitespace.
        var c = s.charAt(i);
        if (bag.indexOf(c) == -1) returnString += c;
    }
    return returnString;
}

function checkInternationalPhone(strPhone){
s=stripCharsInBag(strPhone,validWorldPhoneChars);
return (isInteger(s) && s.length >= minDigitsInIPhoneNumber);
}

function correctPNG() // correctly handle PNG transparency in Win IE 5.5 & 6.
{
   var arVersion = navigator.appVersion.split ("MSIE")
   var version = parseFloat(arVersion[1])
   if ((version >= 5.5) && (document.body.filters))
   {
      for(var i=0; i<document.images.length; i++)
      {
         var img = document.images[i]
         var imgName = img.src.toUpperCase()
         if (imgName.substring(imgName.length-3, imgName.length) == "PNG")
         {
            var imgID = ( img.id) ? "id='" + img.id + "' " : ""
            var imgClass = (img.className) ? "class='" + img.className + "' " : ""
            var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' "
            var imgStyle = "display:inline-block;" + img.style.cssText
            if (img.align == "left") imgStyle = "float:left;" + imgStyle
            if (img.align == "right") imgStyle = "float:right;" + imgStyle
            if ( img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle
            var strNewHTML = "<span " + imgID + imgClass + imgTitle
            + " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";"
            + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
            + "(src=\'" + img.src + "\', sizingMethod='scale');\"></span>"
            img.outerHTML = strNewHTML
            i = i-1
         }
      }
   }   
}
window.attachEvent("onload", correctPNG);

function temp_validation() {

		var flag=0;
		var chklen = document.temp.radtemp.length;
		if(chklen >1)
		{
			for(index=0;index <chklen; index++){
				if(document.temp.radtemp[index].checked == false){
					flag++;
				}
			}
			if(flag == chklen){
				alert("Please choose any one of the Template");
				return false;
			}
		}
		else
		{
			if(document.temp.radtemp.checked == false)
			{
				alert("Please choose any one of the Template");
				return false;
			}
		}
		return true;
}

function showhideAweber_addcap()

{

		//alert(document.frm_updateform.Aweber.checked);

		if (document.frm_updateform.Aweber.checked)

		{

			delistyle=document.getElementById("Aweber1");

		    if(delistyle)

			{

				delistyle.style.display="block";

				delistyle.style.visibility="visible";

			}				

		}

		else

		{

			delistyle=document.getElementById("Aweber1");

			if(delistyle)

			{

				delistyle.style.display="none";

				delistyle.style.visibility="hidden";

			}

		}

	}
	

function showhideAweber()

{

		if (document.frm_updateform.Tiedwith[1].value == "Aweber")

		{

			showstyle=document.getElementById("Aweber1");
			hidestyle=document.getElementById("Getresponse1");

			showstyle.style.display="block";
			showstyle.style.visibility="visible";

			hidestyle.style.display="none";
			hidestyle.style.visibility="hidden";
		}

		else

		{


			showstyle=document.getElementById("Aweber1");
			hidestyle=document.getElementById("Getresponse1");

			showstyle.style.display="none";
			showstyle.style.visibility="hidden";

			hidestyle.style.display="none";
			hidestyle.style.visibility="hidden";


		}

	}

function insertMoreUpload_form() 

{ 

	var nUploads = parseInt(document.getElementById('NumberOfUploads').value)+1;		 

	var tbody = document.getElementById("tabUpload").getElementsByTagName("tbody")[1]; 

	var row = document.createElement("TR"); 



	//insert second <td>

	var cell2 = document.createElement("TD");

	//cell2.setAttribute("colspan","2");

	cell2.setAttribute("valign","middle");

	cell2.setAttribute("align","center");

	//File

	var eInput = document.createElement("INPUT"); 

	eInput.setAttribute("type","text");

	eInput.setAttribute("name","labelname" + nUploads);

	eInput.setAttribute("id","Label");

	eInput.setAttribute("style", "FONT: 11px Verdana, Arial, Helvetica, sans-serif; text-decoration:none;");	

	cell2.appendChild(eInput);

	

	// append all <td> to <tr>

	//insert second <td>

	var cell3 = document.createElement("TD");

	cell3.setAttribute("valign","middle");

	cell3.setAttribute("align","center");

	//File

	/*var eInput = document.createElement("INPUT"); 

	eInput.setAttribute("type","text");

	eInput.setAttribute("name","fieldtype" + nUploads);

	eInput.setAttribute("id","fieldtype" + nUploads);

	eInput.setAttribute("style", "FONT: 11px Verdana, Arial, Helvetica, sans-seri; text-decoration:none; color: #006699;");	

	cell3.appendChild(eInput);*/

	

	//File

	listarray = new Array("TextBox","TextArea","ListBox","RadioButton","CheckBox");

	var eInput = document.createElement("select"); 

	eInput.setAttribute("name","fieldtype" + nUploads);

	eInput.setAttribute("id","Type");

	eInput.setAttribute("style", "FONT: 11px Verdana, Arial, Helvetica, sans-seri; text-decoration:none; color: #006699;");

		var doc = eInput.ownerDocument;

		if (!doc)

			doc = eInput.document;

		for(listindex = 0; listindex < 5; listindex++)

		{

			var opt = doc.createElement('OPTION');

			opt.value = listarray[listindex];

			opt.text = listarray[listindex];

			eInput.options.add(opt,listindex);

		}



	//eInput.new Option("TextBox","TextBox");

	cell3.appendChild(eInput);

	

	



	var cell4 = document.createElement("TD");

	//cell2.setAttribute("colspan","2");

	cell4.setAttribute("valign","top");

	cell4.setAttribute("align","center");

	//File

	var eInput = document.createElement("INPUT"); 

	eInput.setAttribute("type","text");

	eInput.setAttribute("name","fieldvalue" + nUploads);

	eInput.setAttribute("id","FieldValue");

	eInput.setAttribute("style", "FONT: 11px Verdana, Arial, Helvetica, sans-seri; text-decoration:none; color: #006699;");	

	cell4.appendChild(eInput);

	

	var cell5 = document.createElement("TD");

	cell5.setAttribute("valign","top");

	cell5.setAttribute("align","center");

	//Checkbox

	//<input type="checkbox" name="select<? //print $Count; ?>" value="on" id="selectscript"/>

	var eInput1 = document.createElement("INPUT"); 

	eInput1.setAttribute("type","checkbox");

	eInput1.setAttribute("name","select" + nUploads);

	eInput1.setAttribute("id","selectscript");

	cell5.appendChild(eInput1);



	row.appendChild(cell5); 

	row.appendChild(cell2); 

	row.appendChild(cell3); 

	row.appendChild(cell4); 

	tbody.appendChild(row);

	document.frm_updateform.NumberOfUploads.value = nUploads;

	return false;

}


function contact_validation()

{

if (document.frm_contact.txtTitle.value == "")

	{

		alert("Please enter the title");

		document.frm_contact.txtTitle.focus();

		return false;

	}

if (document.frm_contact.txtNotes.value == "")

	{

		alert("Please enter the Notes");

		document.frm_contact.txtNotes.focus();

		return false;

	}

	

if (document.frm_contact.chkbox1.checked == true)

{

	if(document.frm_contact.txtHeading.value=="")

	{

		alert("Please enter the Event Title");

		document.frm_contact.txtHeading.focus();

		return false;

	}

	if(document.frm_contact.txtDate.value=="")

	{

		alert("Please enter the Event Date");

		document.frm_contact.txtDate.focus();

		return false;

	}
	
		if(document.frm_contact.txtHour.value=="Select")

	{

		alert("Please Choose the Hour");

		document.frm_contact.txtHour.focus();

		return false;

	}

	if(document.frm_contact.txtMinute.value=="Select")

	{

		alert("Please Choose the Minute");

		document.frm_contact.txtMinute.focus();

		return false;

	}

	if(document.frm_contact.txtLocation.value=="")

	{

		alert("Please enter the Location");

		document.frm_contact.txtLocation.focus();

		return false;

	}

}

}


function auto_vali(url)

{

	document.form1.target = '_self';

	document.form1.action = url;

	

	if(document.form1.varSubject.value=="")

	{

		alert("Please enter the Subject");

		document.form1.varSubject.focus();

		return false;

	}

	if(document.form1.varDayToSend.value=="")

	{

		alert("Please enter the Day To Send");

		document.form1.varDayToSend.focus();

		return false;

	}

	if(isNaN(document.form1.varDayToSend.value))

	{

		alert("Day To Send Must be Numeric");

		document.form1.varDayToSend.focus();

		document.form1.varDayToSend.value="";

		return false;

	}

	if(document.form1.varFromName.value=="")

	{

		alert("Please enter the From Name");

		document.form1.varFromName.focus();

		return false;

	}

	if(document.form1.varFromEmail.value=="")

	{

		alert("Please enter the From Email");

		document.form1.varFromEmail.focus();

		return false;

	}

	if (!validateEmail(document.form1.varFromEmail.value,1,1)) 

	{

		document.form1.varFromEmail.focus();

		return false;

	}

}
function popupmenus(url)

{

	width=screen.width;

	//height=screen.height;

	center=width/2;

	//center1=height/2;

	leftpos=center-244;

	//toppos=center1-150;

	newwindow=window.open(url,'ImageDisplay','height=700,width=500,left='+leftpos+',top=0,resizable=yes,scrollbars=yes');

	if (window.focus) {newwindow.focus()}

}




// Pay Credit - Page Content

function credit_pay()

{



	if(document.frm_accountinfo.callAmount.value == "")

	{

		alert("Please Enter the Amount");

		document.frm_accountinfo.callAmount.focus();

		return false;

	}

	if(isNaN(document.frm_accountinfo.callAmount.value))

	{

		alert("Amount Should be in Numeric");

		document.frm_accountinfo.callAmount.focus();

		return false;

	}

}









//script for newsletter validation

function voice_validation()

{

	

	if(document.frm_sub.varTitle.value=="")

	{

		alert("Please enter the Title");

		document.frm_sub.varTitle.focus();

		return false;

	}

	if(document.frm_sub.varPhone.value=="")

	{

		alert("Please enter the Phone");

		document.frm_sub.varPhone.focus();

		return false;

	}

	

	myOption = -1;

	for (i=document.frm_sub.filetype.length-1; i > -1; i--) {

	if (document.frm_sub.filetype[i].checked) {

	myOption = i; i = -1;

	}

	}

	if (myOption == -1) {

	alert("Please select Voice call type");

	return false;

	}

	

	if(document.frm_sub.filetype[0].checked == true || document.frm_sub.filetype[1].checked == true)

	{

		if(document.frm_sub.filetype[0].checked == true)

		{

			//alert(document.frm_sub.file.value);

			if(document.frm_sub.Record.value=="")

			{

				alert("Please select the recorded call");

				document.frm_sub.Record.focus();

				return false;

			}

		}

		else if(document.frm_sub.filetype[1].checked ==true)

		{

			if(document.frm_sub.file.value=="")

			{

				alert("Please upload audio file");

				document.frm_sub.file.focus();

				return false;

			}

		}		

	}		



	var flag	=	"off";

	for (i = 0; i<document.frm_sub.varCampName.options.length; i++ )

	{

		if(document.frm_sub.varCampName.options[i].selected)

		{

			flag	=	"on";

		}

	}

	if(flag	==	"off")

	{

		alert("Please Select Campaign");

		return false;

	}

}



function record_validation()

{

	if(document.frm_sub.varName.value=="")

	{

		alert("Please enter the Name");

		document.frm_sub.varName.focus();

		return false;

	}

	if(document.frm_sub.varPhone.value=="")

	{

		alert("Please enter the Phone");

		document.frm_sub.varPhone.focus();

		return false;

	}

}


function showhidevoicetable(id)

{

	if (document.getElementById)

	{

		if(id=="record")

		{

			obj = document.getElementById("record");		

			obj1 = document.getElementById("upload");			

			obj.style.display = "block";

			obj.style.visibility = "visible";

			obj1.style.display = "none";

			obj1.style.visibility = "hidden";			

		}

		else if(id=="upload")

		{

			obj = document.getElementById("upload");

			obj1 = document.getElementById("record");

			obj.style.display = "block";

			obj.style.visibility = "visible";

			obj1.style.display = "none";

			obj1.style.visibility = "hidden";			

		}

		else

		{

			obj1 = document.getElementById("record");

			obj = document.getElementById("upload");

			

			obj1.style.display = "none";

			obj1.style.visibility = "hidden";			

			obj.style.display = "none";

			obj.style.visibility = "hidden";			

		}

	}

}	
function calldel(m)

{

  if(!confirm(m))

  {

    return false;

  }

  else

  return true;

}

function popupEmail(url)

{

	width=screen.width;

	//height=screen.height;

	center=width/2;

	//center1=height/2;

	leftpos=center-244;

	//toppos=center1-150;

	newwindow=window.open(url,'ImageDisplay','height=500,width=600,left='+leftpos+',top=0,resizable=yes,scrollbars=yes');

	if (window.focus) {newwindow.focus()}

}

function popupmenu1(url)

{

	newwindow=window.open(url,'ImageDisplay','height=500,width=500,left=0,top=0,resizable=yes,scrollbars=yes');

	if (window.focus) {newwindow.focus()}

}

function popup(url)

{

	newwindow=window.open(url,'ImageDisplay','height=500,width=800,left=0,top=0,resizable=yes,scrollbars=yes');

	if (window.focus) {newwindow.focus()}

}

function popupmail(url)

{

	width=screen.width;

	//height=screen.height;

	center=width/2;

	//center1=height/2;

	leftpos=center-244;

	//toppos=center1-150;

	newwindow=window.open(url,'ImageDisplay','height=600,width=650,left='+leftpos+',top=0,resizable=yes,scrollbars=yes');

	if (window.focus) {newwindow.focus()}

}

function popupsmall(url)

{

	newwindow=window.open(url,'DomainPopup','height=350,width=300,resizable=yes,scrollbars=yes');

	if (window.focus) {newwindow.focus()}

}



function poplinks(url)

{

	//var left = (window.screen.width/2)-250;

	newwindow=window.open(url,'ImageDisplay','height=525,width=790,left=100,top=50,resizable=yes,scrollbars=yes');

	if (window.focus) {newwindow.focus()}

}



function poporder(url)

{

	var left = (window.screen.width/2)-250;

	newwindow=window.open(url,'name','scrollbars=yes,resizable=no,height=650,width=700,left='+left+',top=20');

	if (window.focus) {newwindow.focus()}

}

function OpenWindow(url,winName,w,h,other)

	{

	var acc = "width=" + w + ",height=" + h + "," + other;

	window.open(url,winName,acc);

	}




//script for event validation

function event_validation()
{
if(document.frm_addevent.chkbox1.checked == true){


	if(document.frm_addevent.txtDate.value=="")

	{

		alert("Please enter the Event Date");

		document.frm_addevent.txtDate.focus();

		return false;

	}

	if(document.frm_addevent.txtHour.value=="Select")

	{

		alert("Please Choose the Hour");

		document.frm_addevent.txtHour.focus();

		return false;

	}

	if(document.frm_addevent.txtMinute.value=="Select")

	{

		alert("Please Choose the Minute");

		document.frm_addevent.txtMinute.focus();

		return false;

	}

	if(document.frm_addevent.txtLocation.value=="")

	{

		alert("Please enter the Location");

		document.frm_addevent.txtLocation.focus();

		return false;

	}



	if(document.frm_addevent.txtLevel.value=="Select")

	{

		alert("Please Choose the priority level");

		document.frm_addevent.txtLevel.focus();

		return false;

	}

}

}

function addcampaign_validate(){
	
	if (document.frm_addcampaign.campaignname.value == "") 
		{
				alert ("Please enter the Campaign Name");
				document.frm_addcampaign.campaignname.focus();
				return false;
		}
		
		if (document.frm_addcampaign.callerno.value == "") 
		{
				alert ("Please enter the Caller Number");
				document.frm_addcampaign.callerno.focus();
				return false;
		}
		
		
		if(document.frm_addcampaign.filetype[0].checked ==  false && document.frm_addcampaign.filetype[1].checked ==  false && document.frm_addcampaign.filetype[2].checked ==  false) {
			alert("Select the Voice call type");
			return false;
			
		}
		
		if(document.frm_addcampaign.filetype[0].checked ==  true) { 
		if (document.frm_addcampaign.Record.value == "") 
		{
				alert ("Please select the Record");
				document.frm_addcampaign.Record.focus();
				return false;
		}
		
		}
		
		
		if(document.frm_addcampaign.filetype[1].checked ==  true) { 
		if (document.frm_addcampaign.file.value == "") 
		{
				alert ("Please browse the Upload Voice Message");
				document.frm_addcampaign.file.focus();
				return false;
		}
		
		}
}

function editcampign_validate(){
	
	if (document.frm_editcampign.campaignname.value == "") 
		{
				alert ("Please enter the Campaign Name");
				document.frm_editcampign.campaignname.focus();
				return false;
		}
		
		if (document.frm_editcampign.callerno.value == "") 
		{
				alert ("Please enter the Caller Number");
				document.frm_editcampign.callerno.focus();
				return false;
		}
		
		
		if(document.frm_editcampign.filetype[0].checked ==  false && document.frm_editcampign.filetype[1].checked ==  false && document.frm_editcampign.filetype[2].checked ==  false) {
			alert("Select the Voice call type");
			return false;
			
		}
		
		if(document.frm_editcampign.filetype[0].checked ==  true) { 
		if (document.frm_editcampign.Record.value == "") 
		{
				alert ("Please select the Record");
				document.frm_editcampign.Record.focus();
				return false;
		}
		
		}
		
		
		if(document.frm_editcampign.filetype[1].checked ==  true) { 
		if (document.frm_editcampign.file.value == "") 
		{
				alert ("Please browse the Upload Voice Message");
				document.frm_editcampign.file.focus();
				return false;
		}
		
		}
}


function page_validation()

{

	var Campaign=document.frm_updateform.Campaign.value;

	if(Campaign=="")

	{

		alert("Please Assign Campaign");

		document.frm_updateform.Campaign.focus();

		return false;

	}

	


/*	

	var Keyword=document.frm_updateform.txtMetaKeywords.value;

	if(Keyword=="")

	{

		alert("Please Enter Keywords");

		document.frm_updateform.txtMetaKeywords.focus();

		return false;

	}	

	var desc=document.frm_updateform.txtMetaDescription.value;

	if(desc=="")

	{

		alert("Please Enter Meta tag Description");

		document.frm_updateform.txtMetaDescription.focus();

		return false;

	}	
if(document.frm_updateform.varEmail.value != "")

	{

		if(!validateEmail(document.frm_updateform.varEmail.value,0,1))

		{

			document.frm_updateform.varEmail.focus();

			return false;

		}

		return true;

	}*/


}