
function MM_showHideLayers() { //v9.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) 
  with (document) if (getElementById && ((obj=getElementById(args[i]))!=null)) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}

function bookmark_Page()
{
	if (navigator.appName == "Microsoft Internet Explorer" && parseInt(navigator.appVersion) >= 4) {
		//window.external.AddFavorite(document.URL,document.title);
		window.external.AddFavorite("http://www.illustrationmundo.com","Illustrationmundo.com");
		window.location="http://www.illustrationmundo.com"
	}
	else
		alert("Your Web browser does not support the setting of bookmarks from script.\nPlease bookmark this page using your browser menu.  Thank you.");
	
	
}
function CheckIllustrators(){
	//initialize
	var problem='no';
	var message='There is a problem with the following fields\n';

	
	if (document.illustrators.medium.value == 0 || document.illustrators.medium.selectedIndex == 0){
		message+='Medium\n';
		problem='yes';
	}
	if (document.illustrators.style.value == 0 || document.illustrators.style.selectedIndex == 0){
		message+='Style\n';
		problem='yes';
	}
	if (document.illustrators.category_1.value == 0 || document.illustrators.category_1.selectedIndex == 0){
		message+='Category 1\n';
		problem='yes';
	}
	if (document.illustrators.category_2.value == 0 || document.illustrators.category_2.selectedIndex == 0){
		message+='Category 2\n';
		problem='yes';
	}
	if (document.illustrators.category_3.value == 0 || document.illustrators.category_3.selectedIndex == 0){
		message+='Category 3\n';
		problem='yes';
	}

	

	
	

	if(problem=='no'){
		return true;
	}else{
		alert(message);
		return false;
	}

}

function CheckLink(){
	//initialize
	var problem='no';
	var message='There is a problem with the following fields\n';

	
	if (document.submitlinks.category.value == 0 || document.submitlinks.category.selectedIndex == 0){
		message+='Category\n';
		problem='yes';
	}
	
	if (document.submitlinks.link_name.value == 0){
		message+='Link Name\n';
		problem='yes';
	}
	
	var the_headline_link=/\b^(http\:\/\/)/
	if (document.submitlinks.link_url.value.search(the_headline_link) == -1 ){
		message+='Link must begin with http://\n';
		problem='yes';
	}
	
	
	
	
		

	
	if (document.submitlinks.link_description.value == 0){
		message+='Link Description\n';
		problem='yes';
	}
	

	

	
	

	if(problem=='no'){
		return true;
	}else{
		alert(message);
		return false;
	}

}

function CheckNews(){
	//initialize
	var problem='no';
	var message='There is a problem with the following fields\n';

	if (document.news.title.value == 0){
		message+='Headline\n';
		problem='yes';
	}
	
	if (document.news.category.value == 0 || document.news.category.selectedIndex == 0){
		message+='Category\n';
		problem='yes';
	}
	if (document.news.str_url.value.length < 8){
		message+='Headline Link\n';
		problem='yes';
	}
	var the_headline_link=/\b^(http\:\/\/)/
	if (document.news.str_url.value.search(the_headline_link) == -1 ){
		message+='Headline Link must begin with http://\n';
		problem='yes';
	}
	
	
	

	
	if (document.news.jpg_image.value == 0 || document.news.jpg_image.selectedIndex == 0){
		message+='75 pixels wide x 75 pixels tall jpg image\n';
		problem='yes';
	}
	


	if(problem=='no'){
		return true;
	}else{
		alert(message);
		return false;
	}

}
function CheckDelete(){
	if (document.delete_form.gone.value == 0 || document.delete_form.gone.selectedIndex == 0){
	alert("If you are sure you want to delete this record\n.. select Yes and hit the delete button");
		return false;
	}else{
		return true;
	}
}

function CheckNewUser(){
	//initialize
	var problem='no';
	var message='There is a problem with the following fields\n';

	if (document.new_user.s_name.value == 0){
		message+='Name\n';
		problem='yes';
	}
	if (document.new_user.s_email.value == 0){
		message+='Email\n';
		problem='yes';
	}
	if (document.new_user.s_password.value == 0){
		message+='Password\n';
		problem='yes';
	}
	if (document.new_user.s_password_2.value == 0){
		message+='Re-type Password\n';
		problem='yes';
	}
	if (document.new_user.form_anti_bot.value == 0){
		message+='Type text from image above\n';
		problem='yes';
	}
	if(document.new_user.s_url.value.length > 1){
		var the_headline_link=/\b^(http\:\/\/)/
		if (document.new_user.s_url.value.search(the_headline_link) == -1 ){
			message+='The URL must begin with http://\n';
			problem='yes';
		}
	}
	

	

	
	
	if(problem=='no'){
		return true;
	}else{
		alert(message);
		return false;
	}

}

function CheckComments(){
	//initialize
	var problem='no';
	var message='There is a problem with the following fields\n';

	if (document.comments.s_name.value == 0){
		message+='Name\n';
		problem='yes';
	}
	if (document.comments.s_email.value == 0){
		message+='Email\n';
		problem='yes';
	}
	
		if (document.comments.s_comment.value == 0){
		message+='Comment\n';
		problem='yes';
	}
	

	
	
	
	

	
	
	

	if(document.comments.s_url.value.length > 1){
		var the_headline_link=/\b^(http\:\/\/)/
		if (document.comments.s_url.value.search(the_headline_link) == -1 ){
			message+='The URL must begin with http://\n';
			problem='yes';
		}
	}
	

	
	
	if(problem=='no'){
		return true;
	}else{
		alert(message);
		return false;
	}

}

function toggleBox(obj,thestate) {
	var el = document.getElementById(obj);
	if ( thestate == 0 ) {
		el.style.display = 'none';
	}
	else {
		el.style.display = 'block';
	}
}

function switchMenu(obj) {
	var el = document.getElementById(obj);
	if ( el.style.display != "none" ) {
		el.style.display = 'none';
	}
	else {
		el.style.display = '';
	}
}

function iswitchMenu(obj) {
	var content = document.getElementById(obj);
	var container = content.parentNode.parentNode.parentNode;
	
	if ( content.style.display == 'none' ) {
		// opening
		container.style.height =  "750px";
		content.style.display = '';
	}
	else {
		// closing
		container.style.height = "375px";
		content.style.display = 'none';
	}
}


function CheckUser(){
	//initialize
	var problem='no';
	var message='There is a problem with the following fields\n';

	if (document.new_user.s_name.value == 0){
		message+='Name\n';
		problem='yes';
	}
	if (document.new_user.s_email.value == 0){
		message+='Email\n';
		problem='yes';
	}
	if (document.new_user.s_password.value == 0){
		message+='Password\n';
		problem='yes';
	}
	if (document.new_user.s_password_2.value == 0){
		message+='Re-type Password\n';
		problem='yes';
	}

	if(document.new_user.s_url.value.length > 1){
		var the_headline_link=/\b^(http\:\/\/)/
		if (document.new_user.s_url.value.search(the_headline_link) == -1 ){
			message+='The URL must begin with http://\n';
			problem='yes';
		}
	}
	
	if(document.new_user.s_rss.value.length > 1){
		var the_rss_link=/\b^(http\:\/\/)/
		if (document.new_user.s_rss.value.search(the_rss_link) == -1 ){
			message+='The RSS feed must begin with http://\n';
			problem='yes';
		}
	}
	
	
	

	
	
	if(problem=='no'){
		return true;
	}else{
		alert(message);
		return false;
	}

}

//popup window for comments
function illustrator_comments(theURL) { //v2.0
  window.open(theURL,'illustrator_comments','scrollbars=yes,resizable=yes,toolbar=no,location=no,width=600,height=200');
}


function toggleBox(obj,thestate) {
	var el = document.getElementById(obj);
	if ( thestate == 0 ) {
		el.style.display = 'none';
	}
	else {
		el.style.display = '';
	}
}

function switchMenu(obj) {
	var el = document.getElementById(obj);
	if ( el.style.display != "none" ) {
		el.style.display = 'none';
	}
	else {
		el.style.display = '';
	}
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}




