﻿function SetError()
{
var error = document.getElementById("ctl00_ContentPlaceHolder1_HiddenError").value; 
alert(error)
return false;
}
/******************************************************/
function Open2Window()
{
window.open('http://www.ibiza-direct.com','w1','width=640,height=480,resizable=1,statusbar=1,scrollbars=1,menubar=1,toolbar=1');
window.open('http://www.ibiza-direct.com','w2','width=300,height=300,resizable=0,status=0,scrollbars=0');
}
/*******************************************************************/
var popUpWin = "";
		var popUpWin = self.location.href;
		var printable = "&print=yes";

		function newwindow() {	
			if (popUpWin.indexOf("?") == -1) {
				printable = "?print=yes";
			}
			window.open(popUpWin+printable,'jav','width=640,height=480,resizable=yes,scrollbars=yes');
		}

		function addBookmark(title,url) {
			if (window.sidebar) {
				window.sidebar.addPanel(title, url,"");
			} else if( document.all ) {
				window.external.AddFavorite( url, title);
			}
		}
		
/**************************************************/		
 function Login_checkHeader()
{
str ='';
var Username =1;
if(document.getElementById("ctl00_login_control1_txtUsername").value=='')
{
str +="\n Enter Username" ;
Username = 0;
}
var Pwd = 1;
if(document.getElementById("ctl00_login_control1_txtPassword").value=='')
{
str +="\n Enter Password " ;
Pwd = 0;
}
if(Pwd == 0)
{
 document.getElementById("ctl00_login_control1_txtPassword").style.backgroundColor ='#faebd7';
 document.getElementById("ctl00_login_control1_txtPassword").focus();
}
else
{
 document.getElementById("ctl00_login_control1_txtPassword").style.backgroundColor ='';
}
if(Username == 0)
{
 document.getElementById("ctl00_login_control1_txtUsername").style.backgroundColor ='#faebd7';
 document.getElementById("ctl00_login_control1_txtUsername").focus();
}
else 
{
document.getElementById("ctl00_login_control1_txtUsername").style.backgroundColor ='';
}
if(str != '')
{
alert(str);
return false;
}
}
/***************************************************/
function  Check_ForgotPass()
{ 
  var emailCode=/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/;
    if(document.getElementById("ctl00_ContentPlaceHolder1_txtEmail").value =='')
    {    
    document.getElementById("ctl00_ContentPlaceHolder1_txtEmail").style.backgroundColor ='#faebd7';
    document.getElementById("ctl00_ContentPlaceHolder1_txtEmail").focus();
    alert("Enter your email");
    return false;    
    } 
    else if(document.getElementById("ctl00_ContentPlaceHolder1_txtEmail").value.search(emailCode)==-1)
    {
    document.getElementById("ctl00_ContentPlaceHolder1_txtEmail").style.backgroundColor ='#faebd7';
    document.getElementById("ctl00_ContentPlaceHolder1_txtEmail").focus();
    alert("Invalid Email");
    return false;  
    }
    else
       document.getElementById("ctl00_ContentPlaceHolder1_txtEmail").style.backgroundColor ='';
}
    
/*****************************************************/
 function Contact_check()
{
str ='';
var Name =1;
if(document.getElementById("ctl00_ContentPlaceHolder1_txtName").value=='')
{
str +="\n Enter Name ";
Name =0;
}
var Email=1;
var emailCode=/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/;
if(document.getElementById("ctl00_ContentPlaceHolder1_txtEmail").value =='')
{
  str +="\n Email required";
  Email =0;
}
else if(document.getElementById("ctl00_ContentPlaceHolder1_txtEmail").value.search(emailCode)==-1)
{
  str +="\n Invalid Email";
  Email = 0;
}
var Phone =1;
if(document.getElementById("ctl00_ContentPlaceHolder1_txtPhone").value=='')
{
str +="\n Telephone Number";
Phone =0;
}

var Message =1;
if(document.getElementById("ctl00_ContentPlaceHolder1_txtMessage").value.length >2000)
{
str +="\n Max 2000 character allow in Message field";
Message =0;
}
if(Message ==0)
{
document.getElementById("ctl00_ContentPlaceHolder1_txtMessage").style.backgroundColor ='#faebd7';
document.getElementById("ctl00_ContentPlaceHolder1_txtMessage").focus();
}
else
{
document.getElementById("ctl00_ContentPlaceHolder1_txtMessage").style.backgroundColor ='';
}
if(Phone ==0)
{
  document.getElementById("ctl00_ContentPlaceHolder1_txtPhone").style.backgroundColor ='#faebd7';
  document.getElementById("ctl00_ContentPlaceHolder1_txtPhone").focus();  
}
else
{
  document.getElementById("ctl00_ContentPlaceHolder1_txtPhone").style.backgroundColor ='';
}

if(Email ==0)
{
  document.getElementById("ctl00_ContentPlaceHolder1_txtEmail").style.backgroundColor ='#faebd7';
  document.getElementById("ctl00_ContentPlaceHolder1_txtEmail").focus();  
}
else
{
  document.getElementById("ctl00_ContentPlaceHolder1_txtEmail").style.backgroundColor ='';
}

if(Name ==0)
{
document.getElementById("ctl00_ContentPlaceHolder1_txtName").style.backgroundColor ='#faebd7';
document.getElementById("ctl00_ContentPlaceHolder1_txtName").focus();
}
else
{
document.getElementById("ctl00_ContentPlaceHolder1_txtName").style.backgroundColor ='';
}
if(str != '')
{
alert(str);
return false;
}
}
    
/**********************************************/
 function Login_check()
{
str ='';
var Username =1;
if(document.getElementById("ctl00_ContentPlaceHolder1_txtUsername").value=='')
{
str +="\n Enter Username" ;
Username = 0;
}
var Pwd = 1;
if(document.getElementById("ctl00_ContentPlaceHolder1_txtPassword").value=='')
{
str +="\n Enter Password " ;
Pwd = 0;
}
if(Pwd == 0)
{
 document.getElementById("ctl00_ContentPlaceHolder1_txtPassword").style.backgroundColor ='#faebd7';
 document.getElementById("ctl00_ContentPlaceHolder1_txtPassword").focus();
}
else
{
 document.getElementById("ctl00_ContentPlaceHolder1_txtPassword").style.backgroundColor ='';
}
if(Username == 0)
{
 document.getElementById("ctl00_ContentPlaceHolder1_txtUsername").style.backgroundColor ='#faebd7';
 document.getElementById("ctl00_ContentPlaceHolder1_txtUsername").focus();
}
else 
{
document.getElementById("ctl00_ContentPlaceHolder1_txtUsername").style.backgroundColor ='';
}
if(str != '')
{
alert(str);
return false;
}
}
/*****************************/
 function Registration_check()
{
str ='';
var Username =1;
if(document.getElementById("ctl00_ContentPlaceHolder1_txtUsername").value=='')
{
str +="\n Enter Username" ;
Username = 0;
}
var Pwd = 1;
if(document.getElementById("ctl00_ContentPlaceHolder1_txtPassword").value=='')
{
str +="\n Enter Password " ;
Pwd = 0;
}
var CPwd = 1;
if(document.getElementById("ctl00_ContentPlaceHolder1_txtCPassword").value=='')
{
str +="\n Enter Confirm Password";
CPwd = 0;
}
else if(document.getElementById("ctl00_ContentPlaceHolder1_txtPassword").value != document.getElementById("ctl00_ContentPlaceHolder1_txtCPassword").value)
{
str +="\n Please Enter Same Password and Confirm Password Entries";
CPwd = 0;
}
var Name =1;
if(document.getElementById("ctl00_ContentPlaceHolder1_txtName").value=='')
{
str +="\n Enter Name ";
Name =0;
}

var Phone =1;
if(document.getElementById("ctl00_ContentPlaceHolder1_txtPhone").value=='')
{
str +="\n Contact number  ";
Phone =0;
}

var Email=1;
var emailCode=/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/;
if(document.getElementById("ctl00_ContentPlaceHolder1_txtEmail").value =='')
{
  str +="\n Email required";
  Email =0;
}
else if(document.getElementById("ctl00_ContentPlaceHolder1_txtEmail").value.search(emailCode)==-1)
{
  str +="\n Invalid Email";
  Email = 0;
}
var Address =1;
if(document.getElementById("ctl00_ContentPlaceHolder1_txtAddress").value=='')
{
str +="\n EnterAddress ";
Address =0;
}
else if(document.getElementById("ctl00_ContentPlaceHolder1_txtAddress").value=='')
{
str +="\n Maximum 200 char allow in Address";
Address =0;
}
if(Address == 0 )
{
 document.getElementById("ctl00_ContentPlaceHolder1_txtAddress").style.backgroundColor ='#faebd7';
 document.getElementById("ctl00_ContentPlaceHolder1_txtAddress").focus();
}
else
 document.getElementById("ctl00_ContentPlaceHolder1_txtAddress").style.backgroundColor ='';

if(Email == 0 )
{
 document.getElementById("ctl00_ContentPlaceHolder1_txtEmail").style.backgroundColor ='#faebd7';
 document.getElementById("ctl00_ContentPlaceHolder1_txtEmail").focus();
}
else
 document.getElementById("ctl00_ContentPlaceHolder1_txtEmail").style.backgroundColor ='';

if(Phone == 0)
{ 
 document.getElementById("ctl00_ContentPlaceHolder1_txtPhone").style.backgroundColor ='#faebd7';
 document.getElementById("ctl00_ContentPlaceHolder1_txtPhone").focus();
}
else
 document.getElementById("ctl00_ContentPlaceHolder1_txtPhone").style.backgroundColor ='';

if(Name == 0)
{ 
 document.getElementById("ctl00_ContentPlaceHolder1_txtName").style.backgroundColor ='#faebd7';
 document.getElementById("ctl00_ContentPlaceHolder1_txtName").focus();
}
else
 document.getElementById("ctl00_ContentPlaceHolder1_txtName").style.backgroundColor ='';

if(CPwd == 0)
{
 document.getElementById("ctl00_ContentPlaceHolder1_txtCPassword").style.backgroundColor ='#faebd7';
 document.getElementById("ctl00_ContentPlaceHolder1_txtCPassword").focus();
}
else
{
 document.getElementById("ctl00_ContentPlaceHolder1_txtCPassword").style.backgroundColor ='';
 }

if(Pwd == 0)
{
 document.getElementById("ctl00_ContentPlaceHolder1_txtPassword").style.backgroundColor ='#faebd7';
 document.getElementById("ctl00_ContentPlaceHolder1_txtPassword").focus();
}
else
{
 document.getElementById("ctl00_ContentPlaceHolder1_txtPassword").style.backgroundColor ='';
}

if(Username == 0)
{
 document.getElementById("ctl00_ContentPlaceHolder1_txtUsername").style.backgroundColor ='#faebd7';
 document.getElementById("ctl00_ContentPlaceHolder1_txtUsername").focus();
}
else 
{
document.getElementById("ctl00_ContentPlaceHolder1_txtUsername").style.backgroundColor ='';
}
if(str != '')
{
alert(str);
return false;
}
}
/**************************/    

function check_NewsLetter()
{
var str ="";
var Name=1;
if(document.getElementById("ctl00_ContentPlaceHolder1_txtName").value =='')
{
  str +="\n Enter Name"; 
  Name=0;  
}
var Email=1;
var emailCode=/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/;
if(document.getElementById("ctl00_ContentPlaceHolder1_txtEmail").value =='')
{
  str +="\n Email required";
  Email =0;
}
else if(document.getElementById("ctl00_ContentPlaceHolder1_txtEmail").value.search(emailCode)==-1)
{
  str +="\n Invalid Email";
  Email = 0;
}
var Category=1;
if(document.getElementById("ctl00_ContentPlaceHolder1_ddlCategory").value =='-Select-' || document.getElementById("ctl00_ContentPlaceHolder1_ddlCategory").value =='-No Category-')
{
  str +="\n Select Category ";  
  Category=0;
}
/////////////////////////////////////////////////////
if(Category ==0)
{
document.getElementById("ctl00_ContentPlaceHolder1_ddlCategory").style.backgroundColor ='#faebd7';
document.getElementById("ctl00_ContentPlaceHolder1_ddlCategory").focus();
}
else
{
document.getElementById("ctl00_ContentPlaceHolder1_ddlCategory").style.backgroundColor ='';
}
if(Email ==0)
{
document.getElementById("ctl00_ContentPlaceHolder1_txtEmail").style.backgroundColor ='#faebd7';
document.getElementById("ctl00_ContentPlaceHolder1_txtEmail").focus();
}
else
{
document.getElementById("ctl00_ContentPlaceHolder1_txtEmail").style.backgroundColor ='';
}
if(Name ==0)
{
document.getElementById("ctl00_ContentPlaceHolder1_txtName").style.backgroundColor ='#faebd7';
document.getElementById("ctl00_ContentPlaceHolder1_txtName").focus();
}
else
{
document.getElementById("ctl00_ContentPlaceHolder1_txtName").style.backgroundColor ='';
}
////////////////////////////
if(str != '')
{
alert(str);
return false;
}
}//end of function


/******************************************************************/