function realypage(bb,cc)
{
var c=bb;
var d='deletepage.php?id='+c+'&showing='+cc;
var a;
a=confirm('Do You Realy Want To Delete The Page');
if(a==true)
{
window.location=d;
}
}
function realy(bb,cc)
{
var c=bb;
var d='deletegallery.php?id='+c+'&showing='+cc;
var a;
a=confirm('Do You Realy Want To Delete The Project');
if(a==true)
{
window.location=d;
}
else
{return false;}
}

function deleteImage(idofimage,galid)
{
var url='deleteimage.php?id='+idofimage+'&galleryid='+galid;
var confirme=confirm('Do You Realy Want To Delete This Image');
if(confirme==true)
{
window.location=url;	
	}
else{
return false;	
}
	}
	
function realyadmin(bb,cc,showEdit,showDelete)
{
var c=bb;
var d='deleteadmin.php?id='+c+'&showing='+cc;
var a;
a=confirm('Do You Realy Want To Delete This Administrator');
if(a==true)
{
window.location=d;
}
else
{return false;}
}


function ChiroSlideShow()
{
document.getElementById('chiroSlide').className="chiroSlide-show";	
}

function ChiroSlideCollaps()
{
document.getElementById('chiroSlide').className="chiroSlide-collaps";	
}

function ChiroSlideShow_ImageEditOption(imageID,imageGalleryid,imageAlt,imageTitle,imageName,showEdit,showDelete)
{
var Browser=navigator.appName;
if(Browser!='Microsoft Internet Explorer')
{
document.getElementById('chiroSlide-mainCointainer').className='chiroSlide-mainCointainer';
document.getElementById('chiroSlide').height=document.body.offsetHeight+'px';
var content='<br /><table style="width:90%" align="center"><tr><td><table><tr><td><table width="75%" border="0"><tr><td colspan="2" class="imgEditopt-image" style="border:1px solid #333333; padding:10px;"><img src="MediumStock/'+imageName+'" alt="'+imageAlt+'" title="'+imageTitle+'" width="150" height="200"/></td></tr><tr><td align="right">'
if(showDelete==true)
{
content=content+'<input name="deleteimg" type="button" value="Delete" class="button" onclick="deleteImage('+imageID+','+imageGalleryid+')" />';
}
content=content+'</td><td align="left"><input name="cancel" type="button" value="Cancel" class="button" onclick="ChiroSlideCollaps()" /></td></tr></table></td></tr><tr><td> <br /><span class="imgedit-details">Name: </span><span class="imgedit-value">'+imageName+'</span><br /><span class="imgedit-details">Image Title: </span><span class="imgedit-value">'+imageTitle+'</span><br /><span class="imgedit-details">Image Alt: </span><span class="imgedit-value">'+imageAlt+'</span><br /><span class="imgedit-details">Project Name: </span><span class="imgedit-value">'+imageGalleryid+'</span></td></tr></table></td><td valign="top">';
if(showEdit==true)
{
content=content+'<div class="editformbg"><div class="editimgheadingtitle">Edit Details of '+imageName+'</div><br /><form id="form2" name="form2" method="post" action="imageeditsub.php"><input name="id" type="hidden" value="'+imageID+'" /><input name="galleryid" type="hidden" value="'+imageGalleryid+'" /><table border="0" align="center" width="400"><tr><td  class="imgedit-details">Image Alt Text : </td><td><input type="text" name="alt" id="alt" class="inputbox" value="'+imageAlt+'" /></td></tr><tr><td  class="imgedit-details">Image Title : </td><td><input type="text" name="title" id="title" value="'+imageTitle+'" class="inputbox" /></td></tr><tr><td></td><td><input name="subEdit" type="submit" value="Submit" class="button" /></td></tr></table></form><br /><br /></div>';
}
content=content+'</td></tr></table><br />';	

document.getElementById('ChiroSlideTitlehere').innerHTML=imageName;
document.getElementById('ChiroSlideContainer').innerHTML=content;	
document.getElementById('chiroSlide').className="chiroSlide-show";	
}
else
{
window.location="editimagedetails.php?id="+imageID;	
	}
}

function checkProfile()
{
	if(document.form1.uid.value=='')
	{
		alert('Plese Enter An User ID.')
		document.form1.uid.focus();
		return false;
		}
	if(document.form1.email.value=='')
	{
		alert('Plese Enter Your Email.')
		document.form1.email.focus();
		return false;
		}
	var is_validEmail=emailCheck (document.form1.email.value);
	
	if(is_validEmail==false)
	{
	document.form1.email.select();
	 return false;	
		}
		
	if(document.form1.pass.value=='')
	{
	alert('Please Enter A Password');
	document.form1.pass.focus();
	return false;
		}
		
    if(document.form1.confirme.value=='')
	{
	alert('Please Enter Confirmation Password');
	document.form1.confirme.focus();
	return false;
		}
		
	if(document.form1.pass.value!=document.form1.confirme.value)
	{
	alert('Sorry, The Password And Confirmation Password Dose Not Match');
	document.form1.pass.value='';
	document.form1.confirme.value='';
	return false;
	}
	
	}
	

function checkGallery()
{
var gallerycategoryhidden=document.getElementById('gallerycategoryhidden').value;
var gallerycategory=document.getElementById('gallerycategory').value;

if(gallerycategoryhidden=='' && gallerycategory=='')
{
alert('Please Choose A Project Type');
document.form1.gallerycategory.focus();
	return false;	
	}

if(document.form1.projectstatus.value=='')
	{
alert('Please Choose Project Status from the list');
	document.form1.projectstatus.focus();
	return false;		
	}

 if(document.form1.gallery.value=='')
	{
alert('Please Enter A Project Name');
	document.form1.gallery.focus();
	return false;		
	}
}

function checkImage()
{
   if(document.form1.alt.value=='')
	{
alert('Please Enter A ALT Tag');
	document.form1.alt.focus();
	return false;		
	}
	 if(document.form1.title.value=='')
	{
alert('Please Enter A Image Title');
	document.form1.title.focus();
	return false;		
	}
	

	 if(!/(\.JPG|\.jpg|\.PNG|\.png|\.GIF|\.gif|\.JPEG|\.jpeg)$/i.test(document.form1.imagefile.value)) 
	 {
		alert("Only '.jpg','.png' Or '.gif' Images Can Be Uploaded");
		return false;
	}
	
}

function checkPage()
{
	if(document.form1.name.value=='')
	{
		alert("Please Enter The Page Name");
		document.form1.name.focus();
		return false;
		
		}
	
	}
	
function checkAdmin()
{
	if(document.form1.name.value=='')
	{
		alert("Please Enter The Name");
		document.form1.name.focus();
		return false;
		
		}
		if(document.form1.uid.value=='')
	{
		alert("Please Enter The User ID");
		document.form1.uid.focus();
		return false;
		
		}
		if(document.form1.email.value=='')
	{
		alert("Please Enter The Email Address");
		document.form1.email.focus();
		return false;
		
		}
	var is_validEmail=emailCheck (document.form1.email.value);
	if(is_validEmail!=true)
	{
		document.form1.email.select();
		return false;
		
		}	
		if(document.form1.pass.value=='')
	{
		alert("Please Enter The Password");
		document.form1.pass.focus();
		return false;
		
		}
			if(document.form1.confirme.value=='')
	{
		alert("Please Re Enter The Password");
		document.form1.confirme.focus();
		return false;
		
		}
		if(document.form1.confirme.value!=document.form1.pass.value)
	{
		alert("Password And Confirmation Password Dose Not Match");
		document.form1.confirme.select();
		return false;
		
		}
	
	}
	
function giveAlert(Title,Content)
{
var Browser=navigator.appName;
if(Browser!='Microsoft Internet Explorer')
{
document.getElementById('ChiroSlideTitlehere').innerHTML=Title;
document.getElementById('ChiroSlideContainer').innerHTML='<br /><span style="font:22px bold arial;color:#333333;font-weight:bold;"><div align="center">'+Content+'</div></span><br /><br />';
document.getElementById('chiroSlide').height=document.body.offsetHeight+'px';
document.getElementById('chiroSlide').className="chiroSlide-show";
document.getElementById('chiroSlide-mainCointainer').className="alert";	
	}
	else
	{
	alert(Content);
		}
	}
	
function getGalleryCategory()
{
var Browser=navigator.appName;
if(Browser!='Microsoft Internet Explorer')
{
var content='';
document.getElementById('ChiroSlideTitlehere').innerHTML='Add New Project Type';
document.getElementById('ChiroSlideContainer').innerHTML='<br /><table border="0" width="500" cellspacing="0" cellpadding="0" align="left"><tr><td  style="font:22px bold arial;color:#333333;font-weight:bold;" align="right" width="465">Enter New Project Type : </td><td align="left" width="325" style="padding-right:10px;"><input type="text" style="width:180px;" name="galcat" id="galcat" class="inputbox" /></td></tr><tr><td>&nbsp;</td><td align="right" width="325" style="padding-right:10px;"><input type="button" name="geturl" id="geturl" class="button" value="Get This"  onclick="setGalleryCategory()"/></td></tr></table><br /><br /><br />';
document.getElementById('chiroSlide-mainCointainer').className="URL";
document.getElementById('chiroSlide').height=document.body.offsetHeight+'px';
document.getElementById('chiroSlide').className="chiroSlide-show";
	}
	else
	{
	var enteredGalCat=prompt('Enter The New Project Type : ','');
	if(enteredGalCat!=null && enteredGalCat!='')
	{
	document.getElementById('gallerycategoryhidden').value=enteredGalCat;
	document.getElementById('gallerycategory').disabled='disabled';
		}
		}
	}
	
function setGalleryCategory()
{
var gallerycategory=document.getElementById('galcat').value;
if(gallerycategory!='')
{
document.getElementById('gallerycategoryhidden').value=gallerycategory;
document.getElementById('gallerycategory').disabled='disabled';
ChiroSlideCollaps();
}
	}


function getURL()
{
var Browser=navigator.appName;
if(Browser!='Microsoft Internet Explorer')
{
var content='';
document.getElementById('ChiroSlideTitlehere').innerHTML='Video URL';
document.getElementById('ChiroSlideContainer').innerHTML='<br /><table border="0" width="500" cellspacing="0" cellpadding="0" align="left"><tr><td  style="font:22px bold arial;color:#333333;font-weight:bold;" align="right">Enter The URL : </td><td align="left" width="325" style="padding-right:10px;"><input type="text" name="url" id="url" class="URLinputbox" /></td></tr><tr><td>&nbsp;</td><td align="right" width="325" style="padding-right:10px;"><input type="button" name="geturl" id="geturl" class="button" value="Get This URL"  onclick="setURL()"/></td></tr></table><br /><br /><br />';
document.getElementById('chiroSlide-mainCointainer').className="URL";
document.getElementById('chiroSlide').height=document.body.offsetHeight+'px';
document.getElementById('chiroSlide').className="chiroSlide-show";
	}
	else
	{
	var enteredURL=prompt('Enter The URL : ','');
	if(enteredURL!=null && enteredURL!='')
	{
	document.getElementById('videotype').value=1;
	document.getElementById('enteredURL').value=enteredURL;
	document.getElementById('videofile').disabled='disabled';
		}
		}
	}
	
function setURL()
{
var url=document.getElementById('url').value;
if(url!='')
{
document.getElementById('enteredURL').value=url;
document.getElementById('videotype').value=1;
document.getElementById('videofile').disabled='disabled';
ChiroSlideCollaps();
}
	}
	
	
function getEMBEDcode()
{
var Browser=navigator.appName;
if(Browser!='Microsoft Internet Explorer')
{
var content='';
document.getElementById('ChiroSlideTitlehere').innerHTML='Video EMBED Code';
document.getElementById('ChiroSlideContainer').innerHTML='<br /><table border="0" width="650" cellspacing="0" cellpadding="0" align="left"><tr><td  style="font:22px bold arial;color:#333333;font-weight:bold;" align="right">Enter The Embed Code : </td><td align="left" width="325" style="padding-right:10px;padding-left:10px;"> <textarea name="embedcode" id="embedcode"  class="textbox" style="width:300px;height:50px;"  ></textarea></td></tr><tr><td>&nbsp;</td><td align="right" width="325" style="padding-right:10px;"><br /><input type="button" name="getEmbed" id="getEmbed" class="button" value="Get This Embed Code"  onclick="setEMBEDcode()"/></td></tr></table><br /><br /><br /><br /><br /><br />';
document.getElementById('chiroSlide-mainCointainer').className="EMBED";
document.getElementById('chiroSlide').height=document.body.offsetHeight+'px';
document.getElementById('chiroSlide').className="chiroSlide-show";	
	}
	else
	{
	var enteredEMBED=prompt('Enter The Embed Code : ','');
	if(enteredEMBED!=null && enteredEMBED!='')
	{
	document.getElementById('videotype').value=2;
	document.getElementById('enteredURL').value=enteredEMBED;
	document.getElementById('videofile').disabled='disabled';
		}
		}
	}
	
function setEMBEDcode()
{
var embedcode=document.getElementById('embedcode').value;
if(embedcode!='')
{
document.getElementById('enteredURL').value=embedcode;
document.getElementById('videotype').value=2;
document.getElementById('videofile').disabled='disabled';
ChiroSlideCollaps();
}
	}
	

function deleteVideo(videoID,galleryID)
{
var realyDelete=confirm('Do You Realy Want To Delete The Video');
if(realyDelete==true)
{
var redirect='deletevideo.php?id='+videoID+'&galid='+galleryID;
window.location=redirect;
	}
else{
return false;
}
	}
	
function checkVideo()
{
var is_video=true;
if(document.form1.title.value=='')
{
alert('Please Enter A Title For The Video');
document.form1.title.focus();
return false;
	}
if(document.form1.enteredURL.value=='')
{
	if(document.form1.videofile.value=='')
	{
alert('Please Choose A Video');	
document.form1.videofile.select();
return false;
	}
}

	}
	
function checkSEO()
{
if(document.form1.title.value=='')
{
alert('Please Enter A Common Page Title');	
document.form1.title.focus();
return false;
	}
if(document.form1.meta_key.value=='')
{
alert('Please Enter A Common Meta Keyword');	
document.form1.meta_key.focus();
return false;
	}
if(document.form1.meta_description.value=='')
{
alert('Please Enter A Common Meta Description');	
document.form1.meta_description.focus();
return false;
	}
	}
	
function checkGENERALSettings()
{
	if(document.form1.sending.value=='')
	{
		alert('Please Enter Administration Sending Email Address');
		document.form1.sending.focus();
		return false;
		}
	var is_validEmail=emailCheck (document.form1.sending.value);
	if(is_validEmail!=true)
	{
	document.form1.sending.select();
	return false;
		}
		if(document.form1.receiving.value=='')
	{
		alert('Please Enter Administration Receiving Email Address');
		document.form1.receiving.focus();
		return false;
		}
	is_validEmail=emailCheck (document.form1.receiving.value);
	if(is_validEmail!=true)
	{
	document.form1.receiving.select();
	return false;
		}
	if(document.form1.pagination.value=='')
	{
		alert('How Many Entries You Want To Show In A Page');
		document.form1.pagination.focus();
		return false;
		}
		
    var is_Number=isInteger(document.form1.pagination.value);
	if(is_Number!=true)
	{
	alert('Pagination Number Field Must Have Numeric Value');
	document.form1.pagination.select();
	return false;
		}
	}
	
function setTopNavStyle(TopNavID)
{
	if(TopNavID>=1 && TopNavID<=5)
	{
document.getElementById('topnav'+TopNavID).className=document.getElementById('topnav'+TopNavID).className+'_fx';
	}
	}
	
function checkFrontEndContactForm()
{
	if(document.Contactform.viewername.value=='')
	{
		alert('Please Enter Your Name');
		document.Contactform.viewername.focus();
		return false;
		}
	if(document.Contactform.vieweremail.value=='')
	{
		alert('Please Enter Your Email');
		document.Contactform.vieweremail.focus();
		return false;
		}
	is_validEmail=emailCheck(document.Contactform.vieweremail.value);	
	if(is_validEmail!=true)
	{
		document.Contactform.vieweremail.select();
		return false;
		}
	if(document.Contactform.viewerphone.value=='')
	{
		alert('Please Enter Your Phone Number');
		document.Contactform.viewerphone.focus();
		return false;
		}
	if(document.Contactform.vieweraddress.value=='')
	{
		alert('Please Enter Your Address');
		document.Contactform.vieweraddress.focus();
		return false;
		}
	if(document.Contactform.viewermessage.value=='')
	{
		alert('Please Enter Message');
		document.Contactform.viewermessage.focus();
		return false;
		}
	}

	

