//###########################################################################################
//###########################################################################################
//###########################################################################################
//###########################################################################################
//#############                                                                                                                                                  #############
//#############                                                                                                                                                  #############
//#############				© Clipart of.com                                                                                                #############
//#############				                                                                                                                       #############
//#############                                                                                                                                                  #############
//###########################################################################################
//###########################################################################################
//###########################################################################################
//###########################################################################################








function royalty_free_licence_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_licence_info();' style='cursor: pointer'><font color='red' style='cursor: hand;'><b>X</b></font></a></td></tr><tr><td class='md'><center>Royalty-free Licence</center><p>Royalty-free images are available for most uses including commercial, editorial and personal use. If you are not sure if your use is ok, please contact us.<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('licence').innerHTML = selected_text;
	return;
	}
function hide_licence_info(){
	var selected_text = '';
	selected_text += '';
	document.getElementById('licence').innerHTML = "This royalty-free clip art image can be used for most commercial, editorial, and personal uses. <a title='Commercial Help' onClick='royalty_free_licence_info();' style='cursor: pointer'><font class='small2'><u>Details</u></font></a>";
	return;
	}
	
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 ClipArtOf.com you agree to and are bound by the terms of this agreement. <p>                                ClipArtOf.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 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 copyrighted logo or a copyrighted 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>                                You shall indemnify and defend ClipArtOf.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>                                ClipArtOf.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</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 handleEnter (field, event) {
		var keyCode = event.keyCode ? event.keyCode : event.which ? event.which : event.charCode;
		if (keyCode == 13) {
			var i;
			for (i = 0; i < field.form.elements.length; i++)
				if (field == field.form.elements[i])
					break;
			i = (i + 1) % field.form.elements.length;
			field.form.elements[i].focus();
			return false;
		} 
		else
		return true;
	}    






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



// 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 purchase_call(image_number){
	var url = "/php/admin.php?do=purchase&image_number=" + image_number;
//	alert(url);
	var myRandom=parseInt(Math.random()*99999999);
	myRequest.open("GET", url + "&rand=" + myRandom, true);
	myRequest.onreadystatechange = purchase_response;
	myRequest.send(null);
	}
function purchase_response(){
	if(myRequest.readyState == 4){
		document.getElementById('waiting').innerHTML = '';
		if(myRequest.status == 200){
			var value = myRequest.responseText; 
			document.getElementById('purchaseresults').innerHTML = value;
			}
		else{
			alert("An error has occurred: " + myrequest.statusText);
			}
		}
	else{
		document.getElementById('waiting').innerHTML = '<img src="/images/throbber.gif">';
		}
	}
	
	
	
	
	
	
	
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="/images/throbber.gif">';
//		}
	}
	
	
	
	
	
	
	
	
	
	
function suggested_description_call(image_number){
	var description = document.description_suggestion_form.description.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="/images/throbber.gif">';
//		}
	}
	
	
	
	
	
	
	
	
	
function newsletter_call(){
	var url = "/cgi-bin/admin.pl?do=newsletter&email=" + document.newsletter_form.email.value;
//	alert(url);
	var myRandom=parseInt(Math.random()*99999999);
	myRequest.open("GET", url + "&rand=" + myRandom, true);
	myRequest.onreadystatechange = newsletter_response;
	myRequest.send(null);
	}
function newsletter_response(){
	if(myRequest.readyState == 4){
		document.getElementById('waiting').innerHTML = '';
		if(myRequest.status == 200){
			var value = myRequest.responseText; 
			document.getElementById('newslettersignupresults').innerHTML = value;
			}
		else{
			alert("An error has occurred: " + myrequest.statusText);
			}
		}
	else{
		document.getElementById('waiting').innerHTML = '<img src="/images/throbber.gif">';
		}
	}
	
	
	
	
	
	
function send_call(){
	var reply_to = document.purchase.reply_to.value;
	var image_number = document.purchase.image_number.value;
	var url = "/php/admin.php?do=purchase&email=y&reply_to=" + encodeURIComponent(reply_to) + "&image_number=" + encodeURIComponent(image_number);
//	alert(url);
	var myRandom=parseInt(Math.random()*99999999);
	myRequest.open("GET", url + "&rand=" + myRandom, true);
	myRequest.onreadystatechange = send_response;
	myRequest.send(null);
	}
function send_response(){
	if(myRequest.readyState == 4){
		document.getElementById('waiting').innerHTML = '';
		if(myRequest.status == 200){
			var value = myRequest.responseText; 
			document.getElementById('emailresults').innerHTML = value;
			}
		else{
			alert("An error has occurred: " + myrequest.statusText);
			}
		}
	else{
		document.getElementById('waiting').innerHTML = '<img src="/images/throbber.gif">';
		}
	}