var now = new Date();	
var now_D = now.getDate();
var now_M = now.getMonth();
var now_Y = now.getYear();








function eula_info(){
	var selected_text = '';
	//selected_text += "<br><table style='border: dotted #CCCC99 1px; padding: 4px;' bgcolor='#ffffff' width='100%' cellpadding='7'><tr><td align='right' valign='top' class='xsm'><a title='Close' onClick='hide_eula_info();' style='cursor: pointer'><font color='red' style='cursor: hand;'><b>X</b></font></a></td></tr><tr><td class='md'>BLANK</td></tr></table>";
	selected_text += "<br><table style='border: dotted #CCCC99 1px; padding: 4px;' bgcolor='#ffffff' width='100%' cellpadding='7'><tr><td align='right' valign='top' class='xsm'><a title='Close' onClick='hide_eula_info();' style='cursor: pointer'><font color='red' style='cursor: hand;'><b>X</b></font></a></td></tr><tr><td class='md'><center>End User License Aggreement (EULA)</center> <p>                                By downloading and using images from ImageEnvision.com you agree to and are bound by the terms of this agreement. <p>                                ImageEnvision.com holds no responsibility from any legal issues that may arise from ANY use of the end user. The end user is responsible for any legal issues or costs resulting in their use.<p>                                Images are non-exclusive which means that others may also download and use the same image for competitive or other purposes. If you wish to purchase exclusive use of the image(s) so no one else can use it, please contact customer service for fees.<p>                                Licenses are not transferable. A license must be purchased for each image and each end user. If you have multiple clients that want to use the same image, you must purchase a license for each client. You cannot use the same license for more than one client.<p>                                The end-user is responsible for all liabilities regarding model and property releases, privacy issues, trademarks, slander, libel, etc., that may arise from the use of the image(s). <p>                                You are responsible for the end-use and any legal and/or any financial liability that may arise from such use. <p>                                You may not use any image found on this site for any illegal or fraudulent purpose.<p>                                Copyright is NOT transfered upon licensing of an image. <p>                                Images may not be used as part of a logo or a trademark. They may be used for logo-type purposes but cannot be copyrighted or trademarked by anyone but the creator.<p>                                Images licensed are for the end user only, no additional parties.<p>                                Distribution of the image(s) must be as an end product. You may not distribute the image(s) on a network, CD, website, or any other means, for free or for charge. Only the copyright holder and/or agent for the copyright holder may license or re-license these images. Again, you must purchase a license for each end user. Example; if you have a layout site for business cards, brochures or layouts, you would need to purchase the license for each customer that chooses to use one of our images.<p>                                Images may not be used on sites such as CafePress.<p>                                Images may not be distributed to other users via web templates.<p>                                You shall indemnify and defend ImageEnvision.com and its image contributors against all claims, liability, damages, costs and expenses, including reasonable legal fees and expenses, arising out of or related to a breach of this Agreement, the use or modification of any Image or combination of any Image with any other material, your failure to abide by any restriction regarding the use of an Image, or any claim by a third party related to the use of an Image, alone or in combination with any other material.<p>                                ImageEnvision.com is not and cannot be held responsible for incorrect identification, titles, descriptions or captions of any images, such as the wrong identification name of a flower. It is up to the end user to make sure identifications are correct for their purposes. If you happen to obtain an image that is incorrectly identified, please contact customer service and we can refund your order or substitute an image within 14 days of purchase.<p>                                Images may contain copyrighted material or trademarks. You are responsible for seeking legal counsel for your use of the image(s). You accept responsibility for all liablilties that may arise from your use of the image(s). <p>                                <center>This EULA posted October 11th 2007<br>Updated March 17th 2008</center><p>                               <center><a href='#purchase_table_top'>Top</a></center></td></tr></table>";
	document.getElementById('eula').innerHTML = selected_text;
	return;
	}
function hide_eula_info(){
	var selected_text = '';
	selected_text += '';
	document.getElementById('eula').innerHTML = "<a title='EULA Information' onClick='eula_info();' style='cursor: pointer'><font class='small2'><u>End User License Aggreement (EULA)</u></font></a>";
	return;
	}






function imagePrice(image_price){
	//alert(image_price);
	document.getElementById('image_price').innerHTML = image_price;
	//document.image_price.innerHTML = image_price;
	}





//function imagePrice(image_price){
//	alert(image_price);
//	var NewImgPrice = '<input type="hidden" name="amount_1" value="' + image_price + '">';
//	document.getElementById('image_price').innerHTML = NewImgPrice;
//	alert(NewImgPrice);
//	}



function check_login_1() {
	//alert('Hello');
	if (document.cookie && document.cookie.indexOf('imageenvision_login') > -1)	{
		var info=read_cookie('imageenvision_login');
		//alert(info);
		if (info[2] == 'true'){location.href="http://www.imageenvision.com/cgi-bin/admin.pl?username="+info[0]+"&password="+info[1];}
		else{location.href="http://www.imageenvision.com/cgi-bin/admin.pl";}
		}
	return;
}

function check_login(username,password) {
		var info=[username,password]; 
		create_cookie('imageenvision_login', info); 
		//alert(document.cookie);
		location.href="http://www.imageenvision.com/cgi-bin/admin.pl?do=login&username="+info[0]+"&password="+info[1];
}

function create_cookie(name,value) {
//	alert(name);
//	alert(value);
	if(name == 'images_per_page'){
		//alert(document.images_per_page_form.images_per_page.value);
		value = '';
		value = document.images_per_page_form.images_per_page.value;
		}
		
	order = value + "; ";
	var date = new Date();
	date.setTime(date.getTime()+(360*24*60*60*1000));
	var expires = "; expires="+date.toGMTString();
	document.cookie = name+"="+order+expires+"; path=/; domain=.imageenvision.com;";
	
	if(name == 'images_per_page'){
		//document.write(location.href);
		var destination = location.href;
		destination = destination.replace(/search\/(.*)\/.*/, "search/$1");
		destination = destination.replace(/new\/.*/, "new");
		
		window.location = destination;
		}
	return;
}

function read_cookie(name)	{
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++)
		{
		var c = ca[i];
		while (c.charAt(0)==' ') { c = c.substring(1,c.length);}
		if (c.indexOf(nameEQ) === 0) { return c.substring(nameEQ.length,c.length);}
		}
	return null;
}





function kill_cookie() {
//	alert('Killed the Cookie');

	var name = "imageenvision_login";
	var order = "; ";
	var date = new Date();
	date.setTime(date.getTime()+(-1*24*60*60*1000));
	var expires = "; expires="+date.toGMTString();

	document.cookie = name+"="+order+expires+"; path=/; domain=.imageenvision.com;";
}



function hi() {
	//alert('HELLO');
}










function editorial_help(){
	var selected_text = "";
	selected_text += "<br><table style='border: dotted #CCCC99 1px; padding: 4px;' bgcolor='#ffffff' width='100%' cellpadding='7'><tr><td class='md'><b>Editorial Royalty Free</b></td><td align='right' valign='top' class='xsm'><a title='Close' onClick='hide_image_restriction_information();'><font color='red' style='cursor: hand;'><b>X</b></font></a></td></tr><tr><td class='md'>Images in this category are available for personal and editorial use (personal web site, blogs, screen saver, news article, magazine article...)<br><br>Some images may have specific restrictions such as &quot;may not be used in Canada&quot; and will be listed on the image page.<br><br>If you are not sure if your use is ok, please contact us.<br><br>Please contact us to obtain permission for images of people or pets that will be used for sensitive issues (abuse, illness, homelessness, depression, diseases, sexuality...)<br><br>Royalty Free (RF) means that you only have to purchase the image license once. You may then use the image forever with no additional fees. Rules DO apply. If you purchase an image for a client, you may not use this image for your own purposes, or for another client. The license would only apply to the first client. If you or another client would like to use the same image, you would need to purchase another license for that end user. You may not use the image in any way that would violate any restrictions (example: may not be used in Canada or editorial use only).</td></tr></table>";
	document.getElementById('image_restrictions_information').innerHTML = selected_text;
	return;
}
function retail_help()	{
	var selected_text = "";
	selected_text += "<br><table style='border: dotted #CCCC99 1px; padding: 4px;' bgcolor='#ffffff' width='100%' cellpadding='7'><tr><td class='md'><b>Retail Royalty Free</b></td><td align='right' valign='top' class='xsm'><a title='Close' onClick='hide_image_restriction_information();'><font color='red' style='cursor: hand;'><b>X</b></font></a></td></tr><tr><td class='md'>Images in this category are available for non-promotional use (retail items such as posters, calendars, greeting cards...), editorial and personal. Images available in this category may NOT be used for any promotional material such as; business web graphis, business print graphics, or items that are used to promote a business.<br><br>If you are not sure if your use is ok, please contact us. Please contact us to obtain permission for images of people or pets that will be used for sensitive issues (abuse, illness, homelessness, depression, diseases, sexuality...)<br><br>Royalty Free (RF) means that you only have to purchase the image license once. You may then use the image forever with no additional fees. Rules DO apply. If you purchase an image for a client, you may not use this image for your own purposes, or for another client. The license would only apply to the first client. If you or another client would like to use the same image, you would need to purchase another license for that end user.</td></tr></table>";
	document.getElementById('image_restrictions_information').innerHTML = selected_text;
	return;
}
function commercial_help()	{
	var selected_text = "";
	selected_text += "<br><table style='border: dotted #CCCC99 1px; padding: 4px;' bgcolor='#ffffff' width='100%' cellpadding='7'><tr><td class='md'><b>Commercial Royalty Free</b></td><td align='right' valign='top' class='xsm'><a title='Close' onClick='hide_image_restriction_information();'><font color='red' style='cursor: hand;'><b>X</b></font></a></td></tr><tr><td class='md'>Images in this category are available for most uses including commercial, editorial and personal. If you are not sure if your use is ok, please contact us.<br><br>Please contact us to obtain permission for images of people or pets that will be used for sensitive issues (abuse, illness, homelessness, depression, diseases, sexuality...)<br><br>Royalty Free (RF) means that you only have to purchase the image license once. You may then use the image forever with no additional fees. Rules DO apply. If you purchase an image for a client, you may not use this image for your own purposes, or for another client. The license would only apply to the first client. If you or another client would like to use the same image, you would need to purchase another license for that end user.</td></tr></table>";
	document.getElementById('image_restrictions_information').innerHTML = selected_text;
	return;
}
function hide_image_restriction_information(){
	var selected_text = "";
	selected_text += "";
	document.getElementById('image_restrictions_information').innerHTML = selected_text;
	return;
}	







//COPYRIGHT
function view_copyright_help()	{
	var selected_text = "";
	selected_text += "<table class=\"border\" bgcolor=\"#f5f5f5\"  border=\"0\" width=\"100%\" height=\"0\" cellpadding=\"0\" cellspacing=\"20\"><tr><td class=\"md\"><h4>Copyright Information</h4><br>55 chars maximum length. <p>Enter the name of the person or legal entity that owns the copyright. (Note: Contributors may only upload their own images)<P>This is a legal notice. Keep it short and accurate.<P>The text should contain no special characters, line breaks, etc., except perhaps, a &copy; symbol.<p>Enter <b>Public Domain</b> if the image was taken from the public domain. (Note: You must have permission to upload PD images)<p> <p>This line may be used underneath an image, on the image page or may be imbedded in an image or the image profile when providing high res &quot;comps&quot;.<P>Examples: <LI>2006 Joseph Schmoe<LI>Joe and Mandy Schmoe<LI>Public Domain<LI>&copy; 2005 Joe Schmoe All Rights Reserved<LI>Copyright 1997 Joe Schmoe All Rights Reserved<p><br><A title=\"Copyright Help\" onClick=\"view_copyright_help();\"><font color=\"blue\">Copyright</font></A> &nbsp; &nbsp; &nbsp; <A title=\"Title Help\" onClick=\"view_title_help();\"><font color=\"blue\">Title</font></A> &nbsp; &nbsp; &nbsp; <A title=\"Caption Help\" onClick=\"view_caption_help();\"><font color=\"blue\">Caption</font></A> &nbsp; &nbsp; &nbsp; <A title=\"Description Help\" onClick=\"view_description_help();\"><font color=\"blue\">Description</font></A> &nbsp; &nbsp; &nbsp; <A title=\"Rating Help\" onClick=\"view_rating_help();\"><font color=\"blue\">Rating</font></A> &nbsp; &nbsp; &nbsp; <A title=\"Keyword Help\" onClick=\"view_keyword_help();\"><font color=\"blue\">Search Term for Similar Images</font></A> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <A title=\"Hide Information\" onClick=\"hide_information();\"><b><font color=\"blue\">Remove Help Files >></font></b></A></td></tr></table>";
	document.getElementById('input_box').innerHTML = selected_text;
	return;
}

//TITLE
function view_title_help()	{
	var selected_text = "";
	selected_text += "<table class=\"border\" bgcolor=\"#f5f5f5\"  border=\"0\" width=\"100%\" height=\"0\" cellpadding=\"0\" cellspacing=\"20\"><tr><td class=\"md\"><h4>Title Information</h4><br>Describe the photo and remember to include the type, &quot;Photo&quot;, &quot;Photo Illustration&quot;, or &quot;Illustration&quot;<p>Examples:<li>Photo of a Golden Retriever Running in a Park<li>Photo Illustration of a Businessman and Woman Talking in an Office Setting<li>Illustration of a Beautiful and Colorful Sunset over the Grand Canyon<li>Photograph of a Little Boy Jumping into His Father's Arms<li>Picture of President George W Bush Making a Campaign Speech in Portland, Maine on December 8, 2003<p><p><br><A title=\"Copyright Help\" onClick=\"view_copyright_help();\"><font color=\"blue\">Copyright</font></A> &nbsp; &nbsp; &nbsp; <A title=\"Title Help\" onClick=\"view_title_help();\"><font color=\"blue\">Title</font></A> &nbsp; &nbsp; &nbsp; <A title=\"Caption Help\" onClick=\"view_caption_help();\"><font color=\"blue\">Caption</font></A> &nbsp; &nbsp; &nbsp; <A title=\"Description Help\" onClick=\"view_description_help();\"><font color=\"blue\">Description</font></A> &nbsp; &nbsp; &nbsp; <A title=\"Rating Help\" onClick=\"view_rating_help();\"><font color=\"blue\">Rating</font></A> &nbsp; &nbsp; &nbsp; <A title=\"Keyword Help\" onClick=\"view_keyword_help();\"><font color=\"blue\">Search Term for Similar Images</font></A> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <A title=\"Hide Information\" onClick=\"hide_information();\"><b><font color=\"blue\">Remove Help Files >></font></b></A></td></tr></table>";
	document.getElementById('input_box').innerHTML = selected_text;
	return;
}

//CAPTION
function view_caption_help()	{
	var selected_text = "";
	selected_text += "<table class=\"border\" bgcolor=\"#f5f5f5\"  border=\"0\" width=\"100%\" height=\"0\" cellpadding=\"0\" cellspacing=\"20\"><tr><td class=\"md\"><h4>Caption Information</h4><br>The caption is a short, concise image description. <p>It should <i>not</i> include words like &quot;Photo&quot;, &quot;Picture&quot;, Photograph&quot;, &quot;Image&quot;, etc., unless the image is <i>of</i> a photograph or picture.<p>Good Examples:<li>Dogs Playing on the Beach<li>Child Crying<li>Man Flying Box Kite in Park<li>Astrophoto: Andromeda Galaxy<p>Bad Examples:<li>Photo of a Dog &nbsp; <-- Remove &quot;Photo of a&quot; and be more descriptive<li>Child &nbsp; <-- Not descriptive enough<li>Kite Picture &nbsp; <-- Not descriptive enough and remove &quot;Picture&quot;<li>Astrophoto Taken with a Meade LXD75 at Prime Focus with ISO 1600 Speed Film &nbsp; <p>Save the lengthy descriptions for the description area and the &quot;Photo of&quot;, &quot;Picture of&quot;, &quot;Illustration of&quot;, etc... for the title area.<p>Please try to be descriptive yet concise.<p><br><A title=\"Copyright Help\" onClick=\"view_copyright_help();\"><font color=\"blue\">Copyright</font></A> &nbsp; &nbsp; &nbsp; <A title=\"Title Help\" onClick=\"view_title_help();\"><font color=\"blue\">Title</font></A> &nbsp; &nbsp; &nbsp; <A title=\"Caption Help\" onClick=\"view_caption_help();\"><font color=\"blue\">Caption</font></A> &nbsp; &nbsp; &nbsp; <A title=\"Description Help\" onClick=\"view_description_help();\"><font color=\"blue\">Description</font></A> &nbsp; &nbsp; &nbsp; <A title=\"Rating Help\" onClick=\"view_rating_help();\"><font color=\"blue\">Rating</font></A> &nbsp; &nbsp; &nbsp; <A title=\"Keyword Help\" onClick=\"view_keyword_help();\"><font color=\"blue\">Search Term for Similar Images</font></A> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <A title=\"Hide Information\" onClick=\"hide_information();\"><b><font color=\"blue\">Remove Help Files >></font></b></A></td></tr></table>";
	document.getElementById('input_box').innerHTML = selected_text;
	return;
}

//DESCRIPTION
function view_description_help()	{
	var selected_text = "";
	selected_text += "<table class=\"border\" bgcolor=\"#f5f5f5\"  border=\"0\" width=\"100%\" height=\"0\" cellpadding=\"0\" cellspacing=\"20\"><tr><td class=\"md\"><h4>Description Information</h4><br>Describe what is happening in the photo and the contents of the photo. <p><FORM><b><font color=\"#666666\">Example 1:</font></B><br><TEXTAREA ROWS=\"6\" COLS=\"95\">Picture of a group of protesters in Ashland, Oregon on December 18th, 2004. In this photograph there are about 100 people carry signs, marching through downtown Ashland. This group of people were demonstrating against expansion of the Ashland Ski Area. The ski area, located atop Mt Ashland, is the main ski resort serving the Rogue Valley in Southern Oregon.</textarea><p><b><font color=\"#666666\">Example 2:</font></B><br><TEXTAREA ROWS=\"6\" COLS=\"95\">This picture shows a happy family sitting on their couch at home, enjoying a relaxing evening in front of the television. In this photograph a father, mother and two kids, a boy, about 10 and a toddler girl, are cuddling together of the sofa eating popcorn and watching a movie on TV. The family is African American and the house is very typical of an upper-middle-class family in the United States. </textarea></form><p><p><br><A title=\"Copyright Help\" onClick=\"view_copyright_help();\"><font color=\"blue\">Copyright</font></A> &nbsp; &nbsp; &nbsp; <A title=\"Title Help\" onClick=\"view_title_help();\"><font color=\"blue\">Title</font></A> &nbsp; &nbsp; &nbsp; <A title=\"Caption Help\" onClick=\"view_caption_help();\"><font color=\"blue\">Caption</font></A> &nbsp; &nbsp; &nbsp; <A title=\"Description Help\" onClick=\"view_description_help();\"><font color=\"blue\">Description</font></A> &nbsp; &nbsp; &nbsp; <A title=\"Rating Help\" onClick=\"view_rating_help();\"><font color=\"blue\">Rating</font></A> &nbsp; &nbsp; &nbsp; <A title=\"Keyword Help\" onClick=\"view_keyword_help();\"><font color=\"blue\">Search Term for Similar Images</font></A> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <A title=\"Hide Information\" onClick=\"hide_information();\"><b><font color=\"blue\">Remove Help Files >></font></b></A></td></tr></table>";
	document.getElementById('input_box').innerHTML = selected_text;
	return;
}

//SEARCH TERMS
function view_search_terms_help()	{
	var selected_text = "";
	selected_text += "<table class=\"border\" bgcolor=\"#f5f5f5\"  border=\"0\" width=\"100%\" height=\"0\" cellpadding=\"0\" cellspacing=\"20\"><tr><td class=\"md\"><h4>Search Terms Information</h4><br>Put yourself in the place of the searcher: would you want <i>this image</i> coming up for <i>this term</i>?<p>Start with the obvious and work towards the not-so-obvious.<p>Terms used should apply directly to that image. <p><form><b><font color=\"#666666\">For a photo of a man walking his german shepherd in a park:</font></b><br><textarea ROWS=\"6\" COLS=\"95\">dog, dogs, german shepherd, german shepherds, dog breed, dog breeds, canine, shepherd, pet, pets, animal, animals, man, men, people, person, man walking dog, men walking dogs, park, parks, walking, walk, man walking a german shepherd</textarea></form><p>Complex terms consisting of more than one word are good as long they are pertinent to the image. An exact match of a search to a complex term gives you the top search result.<p>Do not use terms that are not <i>directly</i> related to the image. Keyword spammers will have their images ranked low so they come up lower than all the other images or your terms will be deleted and we will re-write them.<p>...if in doubt, leave it out.<p><br><A title=\"Copyright Help\" onClick=\"view_copyright_help();\"><font color=\"blue\">Copyright</font></A> &nbsp; &nbsp; &nbsp; <A title=\"Title Help\" onClick=\"view_title_help();\"><font color=\"blue\">Title</font></A> &nbsp; &nbsp; &nbsp; <A title=\"Caption Help\" onClick=\"view_caption_help();\"><font color=\"blue\">Caption</font></A> &nbsp; &nbsp; &nbsp; <A title=\"Description Help\" onClick=\"view_description_help();\"><font color=\"blue\">Description</font></A> &nbsp; &nbsp; &nbsp; <A title=\"Rating Help\" onClick=\"view_rating_help();\"><font color=\"blue\">Rating</font></A> &nbsp; &nbsp; &nbsp; <A title=\"Keyword Help\" onClick=\"view_keyword_help();\"><font color=\"blue\">Search Term for Similar Images</font></A> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <A title=\"Hide Information\" onClick=\"hide_information();\"><b><font color=\"blue\">Remove Help Files >></font></b></A></td></tr></table>";
	document.getElementById('input_box').innerHTML = selected_text;
	return;
}




//KEYWORD
function view_keyword_help()	{
	var selected_text = "";
	selected_text += "<table class=\"border\" bgcolor=\"#f5f5f5\"  border=\"0\" width=\"100%\" height=\"0\" cellpadding=\"0\" cellspacing=\"20\"><tr><td class=\"md\"><h4>Keyword Information</h4><br>This will add a list of similar images beneath your main image.<p>Only use 1 search term.<p>For instance, if you have a picture of a cat then use 1 search term like cat, or feline, or pet, or animal.<p>Dont use a term like house, or car, or donkey, if the picture is of a cat.<p><br><A title=\"Copyright Help\" onClick=\"view_copyright_help();\"><font color=\"blue\">Copyright</font></A> &nbsp; &nbsp; &nbsp; <A title=\"Title Help\" onClick=\"view_title_help();\"><font color=\"blue\">Title</font></A> &nbsp; &nbsp; &nbsp; <A title=\"Caption Help\" onClick=\"view_caption_help();\"><font color=\"blue\">Caption</font></A> &nbsp; &nbsp; &nbsp; <A title=\"Description Help\" onClick=\"view_description_help();\"><font color=\"blue\">Description</font></A> &nbsp; &nbsp; &nbsp; <A title=\"Rating Help\" onClick=\"view_rating_help();\"><font color=\"blue\">Rating</font></A> &nbsp; &nbsp; &nbsp; <A title=\"Keyword Help\" onClick=\"view_keyword_help();\"><font color=\"blue\">Search Term for Similar Images</font></A> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <A title=\"Hide Information\" onClick=\"hide_information();\"><b><font color=\"blue\">Remove Help Files >></font></b></A></td></tr></table>";
	document.getElementById('input_box').innerHTML = selected_text;
	return;
}





//RATING
function view_rating_help()	{
	var selected_text = "";
	selected_text += "<table class=\"border\" bgcolor=\"#f5f5f5\"  border=\"0\" width=\"100%\" height=\"0\" cellpadding=\"0\" cellspacing=\"20\"><tr><td class=\"md\"><h4>Rating Information</h4><br>Rank your image high if you want it to show up at the top of your search results.<p>Rank it low to show up at the bottom of your search results.<p><br><A title=\"Copyright Help\" onClick=\"view_copyright_help();\"><font color=\"blue\">Copyright</font></A> &nbsp; &nbsp; &nbsp; <A title=\"Title Help\" onClick=\"view_title_help();\"><font color=\"blue\">Title</font></A> &nbsp; &nbsp; &nbsp; <A title=\"Caption Help\" onClick=\"view_caption_help();\"><font color=\"blue\">Caption</font></A> &nbsp; &nbsp; &nbsp; <A title=\"Description Help\" onClick=\"view_description_help();\"><font color=\"blue\">Description</font></A> &nbsp; &nbsp; &nbsp; <A title=\"Rating Help\" onClick=\"view_rating_help();\"><font color=\"blue\">Rating</font></A> &nbsp; &nbsp; &nbsp; <A title=\"Keyword Help\" onClick=\"view_keyword_help();\"><font color=\"blue\">Search Term for Similar Images</font></A> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <A title=\"Hide Information\" onClick=\"hide_information();\"><b><font color=\"blue\">Remove Help Files >></font></b></A></td></tr></table>";
	document.getElementById('input_box').innerHTML = selected_text;
	return;
}






//Hide information
function hide_information()	{
	var selected_text = "";
	selected_text += "";
	document.getElementById('input_box').innerHTML = selected_text;
	return;
}	







//HELP LINKS
//<A title=\"Copyright Help\" onClick=\"view_copyright_help();\"><font color=\"blue\">Copyright</font></A> &nbsp; &nbsp; &nbsp; <A title=\"Title Help\" onClick=\"view_title_help();\"><font color=\"blue\">Title</font></A> &nbsp; &nbsp; &nbsp; <A title=\"Caption Help\" onClick=\"view_caption_help();\"><font color=\"blue\">Caption</font></A> &nbsp; &nbsp; &nbsp; <A title=\"Description Help\" onClick=\"view_description_help();\"><font color=\"blue\">Description</font></A> &nbsp; &nbsp; &nbsp; <A title=\"Rating Help\" onClick=\"view_rating_help();\"><font color=\"blue\">Rating</font></A> &nbsp; &nbsp; &nbsp; <A title=\"Keyword Help\" onClick=\"view_keyword_help();\"><font color=\"blue\">Search Term for Similar Images</font></A> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <A title=\"Hide Information\" onClick=\"hide_information();\"><b><font color=\"blue\">Remove Help Files >></font></b></A>

//TEMPLATE
//function view_rating_help()	{
//	var selected_text = "";
//	selected_text += "<table class=\"border\" bgcolor=\"#f5f5f5\"  border=\"0\" width=\"100%\" height=\"0\" cellpadding=\"0\" cellspacing=\"20\"><tr><td class=\"md\"><h4>Search Terms Information</h4><br>BLANK<p><br><A title=\"Copyright Help\" onClick=\"view_copyright_help();\"><font color=\"blue\">Copyright</font></A> &nbsp; &nbsp; &nbsp; <A title=\"Title Help\" onClick=\"view_title_help();\"><font color=\"blue\">Title</font></A> &nbsp; &nbsp; &nbsp; <A title=\"Caption Help\" onClick=\"view_caption_help();\"><font color=\"blue\">Caption</font></A> &nbsp; &nbsp; &nbsp; <A title=\"Description Help\" onClick=\"view_description_help();\"><font color=\"blue\">Description</font></A> &nbsp; &nbsp; &nbsp; <A title=\"Rating Help\" onClick=\"view_rating_help();\"><font color=\"blue\">Rating</font></A> &nbsp; &nbsp; &nbsp; <A title=\"Keyword Help\" onClick=\"view_keyword_help();\"><font color=\"blue\">Search Term for Similar Images</font></A> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <A title=\"Hide Information\" onClick=\"hide_information();\"><b><font color=\"blue\">Remove Help Files >></font></b></A></td></tr></table>";
//	document.getElementById('input_box').innerHTML = selected_text;
//	return;
//}





//function show_textarea_box_for_description()	{
//	var selected_text = "";
//	selected_text += "<table class=\"sm\" width=\"0\"><tr><td><TEXTAREA name=\"description\" cols=\"50\" rows=\"12\"></TEXTAREA></td></tr></table>";
//	document.getElementById('input_box').innerHTML = selected_text;
//	return;
//}

















///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

//DESCRIPTION
function show_find_and_replace_for_description()	{
	var selected_text = "";
	selected_text += "<table class=\"sm\" width=\"0\"><tr><td>Find: <INPUT type=\"text\" size=\"29\" name=\"find\" value=\"\"> </td><td>Replace: <INPUT type=\"text\" size=\"29\" name=\"replace\" value=\"\"></td></tr></table>";
	document.getElementById('input_box').innerHTML = selected_text;
	return;
}
function show_textarea_box_for_description()	{
	var selected_text = "";
	selected_text += "<table class=\"sm\" width=\"0\"><tr><td><TEXTAREA name=\"description\" cols=\"50\" rows=\"12\"></TEXTAREA></td></tr></table>";
	document.getElementById('input_box').innerHTML = selected_text;
	return;
}









//USE RESTRICTIONS
function show_find_and_replace_for_use_restrictions()	{
	var selected_text = "";
	selected_text += "<table class=\"sm\" width=\"0\"><tr><td>Find: <INPUT type=\"text\" size=\"29\" name=\"find\" value=\"\"> </td><td>Replace: <INPUT type=\"text\" size=\"29\" name=\"replace\" value=\"\"></td></tr></table>";
	document.getElementById('input_box').innerHTML = selected_text;
	return;
}
function show_textarea_box_for_use_restrictions()	{
	var selected_text = "";
	selected_text += "<table class=\"sm\" width=\"0\"><tr><td><TEXTAREA name=\"use_restrictions\" cols=\"50\" rows=\"12\"></TEXTAREA></td></tr></table>";
	document.getElementById('input_box').innerHTML = selected_text;
	return;
}







//TITLE
function show_find_and_replace_input_box_for_the_title()	{
	var selected_text = "";
	selected_text += "<table class=\"sm\" width=\"0\"><tr><td>Find: <INPUT type=\"text\" size=\"29\" name=\"find\" value=\"\"> </td><td>Replace: <INPUT type=\"text\" size=\"29\" name=\"replace\" value=\"\"></td></tr></table>";
	document.getElementById('input_box').innerHTML = selected_text;
	return;
}
function show_input_box_for_the_title()	{
	var selected_text = "";
	selected_text += "<table class=\"sm\" width=\"0\"><tr><td><input type=\"text\" size=\"65\" name=\"title\" value=\"\" ></td></tr></table>";
	document.getElementById('input_box').innerHTML = selected_text;
	return;
}






//CAPTION
function show_find_and_replace_input_box_for_the_caption()	{
	var selected_text = "";
	selected_text += "<table class=\"sm\" width=\"0\"><tr><td>Find: <INPUT type=\"text\" size=\"29\" name=\"find\" value=\"\"> </td><td>Replace: <INPUT type=\"text\" size=\"29\" name=\"replace\" value=\"\"></td></tr></table>";
	document.getElementById('input_box').innerHTML = selected_text;
	return;
}
function show_input_box_for_the_caption()	{
	var selected_text = "";
	selected_text += "<table class=\"sm\" width=\"0\"><tr><td><input type=\"text\" size=\"65\" name=\"caption\" value=\"\" ></td></tr></table>";
	document.getElementById('input_box').innerHTML = selected_text;
	return;
}






//SEARCH TERMS
function show_find_and_replace_for_search_terms()	{
	var selected_text = "";
	selected_text += "<table class=\"sm\" width=\"0\"><tr><td>Find: <INPUT type=\"text\" size=\"29\" name=\"find\" value=\"\"> </td><td>Replace: <INPUT type=\"text\" size=\"29\" name=\"replace\" value=\"\"></td></tr></table>";
	document.getElementById('input_box').innerHTML = selected_text;
	return;
}
function show_textarea_box_for_search_terms()	{
	var selected_text = "";
	selected_text += "<table class=\"sm\" width=\"0\"><tr><td><TEXTAREA name=\"search_terms\" cols=\"50\" rows=\"12\"></TEXTAREA></td></tr></table>";
	document.getElementById('input_box').innerHTML = selected_text;
	return;
}





//KEY TERM
function show_find_and_replace_boxes_for_key_term()	{
	var selected_text = "";
	selected_text += "<table class=\"sm\" width=\"0\"><tr><td>Find: <INPUT type=\"text\" size=\"29\" name=\"find\" value=\"\"> </td><td>Replace: <INPUT type=\"text\" size=\"29\" name=\"replace\" value=\"\"></td></tr></table>";
	document.getElementById('input_box').innerHTML = selected_text;
	return;
}
function show_input_box_for_key_term()	{
	var selected_text = "";
	selected_text += "<table class=\"sm\" width=\"0\"><tr><td><input type=\"text\" size=\"29\" name=\"key_term\" value=\"\" ></td></tr></table>";
	document.getElementById('input_box').innerHTML = selected_text;
	return;
}








	
	



// sending a server request
function getXMLHTTPRequest(){
	var req = false;
	try{req = new XMLHttpRequest();} /*  e.g. Firefox  */
	catch(err1){
		try{req = new ActiveXObject("Msxm12.XMLHTTP");} /*  some versions IE  */
		catch(err2){ 
			try{req = new ActiveXObject("Microsoft.XMLHTTP");} /*  some versions IE  */
			catch(err3){req = false;}
			}
		}
	return req;
	}
var myRequest = getXMLHTTPRequest();
	
	
	
	
function suggest_new_description_call(image_number){
	var url = "/php/admin.php?do=description_suggestion&image_number=" + image_number;
//	alert(url);
	var myRandom=parseInt(Math.random()*99999999);
	myRequest.open("GET", url + "&rand=" + myRandom, true);
	myRequest.onreadystatechange = suggest_new_description_response;
	myRequest.send(null);
	}
function suggest_new_description_response(){
	if(myRequest.readyState == 4){
//		document.getElementById('waiting').innerHTML = '';
		if(myRequest.status == 200){
			var value = myRequest.responseText; 
			document.getElementById('new_description_results').innerHTML = value;
			}
		else{
			alert("An error has occurred: " + myrequest.statusText);
			}
		}
//	else{
//		document.getElementById('waiting').innerHTML = '<img src="http://www.clipartof.com/images/throbber.gif">';
//		}
	}
	
	
	
function suggested_description_call(){
	var description = document.description_suggestion_form.description.value;
	var image_number = document.description_suggestion_form.image_number.value;
	var url = "/php/admin.php?do=suggested_description&description=" + description + "&image_number=" + image_number;
	//alert(url);
	var myRandom=parseInt(Math.random()*99999999);
	myRequest.open("GET", url + "&rand=" + myRandom, true);
	myRequest.onreadystatechange = suggested_description_response;
	myRequest.send(null);
	}
function suggested_description_response(){
	if(myRequest.readyState == 4){
//		document.getElementById('waiting').innerHTML = '';
		if(myRequest.status == 200){
			var value = myRequest.responseText; 
			document.getElementById('results_from_suggesting_new_description').innerHTML = value;
			}
		else{
			alert("An error has occurred: " + myrequest.statusText);
			}
		}
//	else{
//		document.getElementById('waiting').innerHTML = '<img src="http://www.clipartof.com/images/throbber.gif">';
//		}
	}