function fullScreenMode(theURL,condition)
{
if(condition>1){
var width=screen.width;
var height=screen.height;
if(parseInt(width)<1024 && parseInt(height)<768)
{
	XXX=window.screen.width;YYY=window.screen.height;paramString="location=1, directories=0, status=0, toolbar=0, menubar=0, top=0, left=0, scrollbars=1, resizable=1, copyhistory=no, width=";paramString+=XXX+", height="+YYY;interactivescreen=window.open(theURL,"interactive",paramString);interactivescreen.focus();
}
else
{
	XXX=window.screen.width;YYY=window.screen.height;paramString="location=1, directories=0, status=0, toolbar=0, menubar=0, top=0, left=0, scrollbars=0, resizable=1, copyhistory=no, width=";paramString+=XXX+", height="+YYY;interactivescreen=window.open(theURL,"interactive",paramString);interactivescreen.focus();}
}
else{location.href="login.jsp";}
}
/*function fullScreenMode(theURL,condition)
{if(condition>1){XXX=window.screen.width;YYY=window.screen.height;paramString="location=1, directories=0, status=0, toolbar=0, menubar=0, top=0, left=0, scrollbars=0, resizable=1, copyhistory=no, width=";paramString+=XXX+", height="+YYY;interactivescreen=window.open(theURL,"interactive",paramString);interactivescreen.focus();}
else{location.href="login.jsp";}}*/
function MM_preloadImages(){var d=document;if(d.images){if(!d.MM_p)d.MM_p=new Array();var i,j=d.MM_p.length,a=MM_preloadImages.arguments;for(i=0;i<a.length;i++)
if(a[i].indexOf("#")!=0){d.MM_p[j]=new Image;d.MM_p[j++].src=a[i];}}}
function MM_swapImgRestore(){var i,x,a=document.MM_sr;for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++)x.src=x.oSrc;}
function MM_findObj(n,d){var p,i,x;if(!d)d=document;if((p=n.indexOf("?"))>0&&parent.frames.length){d=parent.frames[n.substring(p+1)].document;n=n.substring(0,p);}
if(!(x=d[n])&&d.all)x=d.all[n];for(i=0;!x&&i<d.forms.length;i++)x=d.forms[i][n];for(i=0;!x&&d.layers&&i<d.layers.length;i++)x=MM_findObj(n,d.layers[i].document);if(!x&&d.getElementById)x=d.getElementById(n);return x;}
function MM_swapImage(){var i,j=0,x,a=MM_swapImage.arguments;document.MM_sr=new Array;for(i=0;i<(a.length-2);i+=3)
if((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x;if(!x.oSrc)x.oSrc=x.src;x.src=a[i+2];}}
var isIE=navigator.appName=='Microsoft Internet Explorer'&&navigator.userAgent.indexOf('Opera')<1?1:0;var isOp=navigator.userAgent.indexOf('Opera')>-1?1:0;var isGe=navigator.userAgent.indexOf('Gecko')>-1&&navigator.userAgent.indexOf('Safari')<1?1:0;var alertTxt;function ToondooScript(){}
ToondooScript.DisableCheckbox=function(dowhatisay,frm)
{if(dowhatisay==1)
{frm.allowremix.disabled=false;}
else
{frm.allowremix.disabled=true;frm.allowremix.checked=false;}}
ToondooScript.updateReDoo=function(frm)
{var allow=0;if(frm.allowredoo.checked==true)
allow=frm.allowredoo.value;message.style.display='block';document.getElementById('mes').innerHTML="Processing... <br><img src='images/processing.gif'>";var xmlhttp=getXmlhttp();xmlhttp.open("POST","ReDooAllow.jsp",true);xmlhttp.onreadystatechange=function()
{if(xmlhttp.readyState==4)
{if(xmlhttp.responseText)
{document.getElementById('mes').innerHTML=xmlhttp.responseText;var t=setTimeout("message.style.display='none';",5000);}}}
xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded');xmlhttp.send("allow="+allow);}
ToondooScript.addCheers=function(val,user,imgPath){message.style.display='block';document.getElementById('mes').innerHTML="Processing <br><img src='images/processing.gif'>";var xmlhttp=getXmlhttp();xmlhttp.open("POST","addCheers.toon",true);xmlhttp.onreadystatechange=function(){if(xmlhttp.readyState==4){Element.hide("CheerId");if(xmlhttp.responseText)
{document.getElementById('mes').innerHTML="Thanks for cheering this one up! Time to feel good!";var t=setTimeout("message.style.display='none';",5000);}}}
xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded');xmlhttp.send("toonId="+val+"&user="+user+"&imgPath="+imgPath);}
ToondooScript.updateProfileDetails=function(frm)
{document.getElementById("persondetailsbutton").disabled=true;document.getElementById("persondetailsbutton").value="Sending...";var country=frm.country.value;var country=frm.country.value;var country=frm.country.value;var country=frm.country.value;var xmlhttp=getXmlhttp();xmlhttp.open("POST","EditProfileAction.jsp",true);xmlhttp.onreadystatechange=function()
{if(xmlhttp.readyState==4)
{document.getElementById('message').style.display='block';document.getElementById('mes').innerHTML="Your Personal Details has been updated!";var t=setTimeout("document.getElementById('message').style.display='none';",5000)
document.getElementById("persondetailsbutton").disabled=false;document.getElementById("persondetailsbutton").value="Submit";}}
xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded');xmlhttp.send("country="+country);}
ToondooScript.changeMail=function(newEmail,userId)
{var xmlhttp=getXmlhttp();xmlhttp.open("POST","changeEmail.jsp",true);document.getElementById("changeemail").disabled=true;document.getElementById("changeemail").value="Sending...";xmlhttp.onreadystatechange=function()
{if(xmlhttp.readyState==4)
{document.getElementById('message').style.display='block';document.getElementById('mes').innerHTML=xmlhttp.responseText;var t=setTimeout("document.getElementById('message').style.display='none';",5000)}
document.getElementById("changeemail").disabled=false;document.getElementById("changeemail").value="Change Email!";}
xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded');xmlhttp.send("sEmail="+newEmail+"&userId="+userId);}
ToondooScript.updatePreferences=function(form)
{var inApp="0";var allowMails="0";var allowUserMails="0";if(form.inApp.checked==true)
inApp=form.inApp.value;if(form.allowMails.checked==true)
allowMails=form.allowMails.value;if(form.allowUserMails.checked==true)
allowUserMails=form.allowUserMails.value;document.getElementById("Updatepref").disabled=true;document.getElementById("Updatepref").value="Updating...";var xmlhttp=getXmlhttp();xmlhttp.open("POST","updateProfilePreferences.jsp",true);xmlhttp.onreadystatechange=function()
{if(xmlhttp.readyState==4)
{document.getElementById("Updatepref").disabled=false;document.getElementById("Updatepref").value="Update";document.getElementById('message').style.display='block';document.getElementById('mes').innerHTML="Your preferences has been changed!";var t=setTimeout("document.getElementById('message').style.display='none';",3000)}}
xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded');xmlhttp.send("inApp="+inApp+"&allowMails="+allowMails+"&allowUserMails="+allowUserMails);}
ToondooScript.WatchUser=function(user,checkboxlen,whois)
{alert(user+" "+checkboxlen+" "+whois);var xmlhttp=getXmlhttp();xmlhttp.open("POST","insertWatchUserInIQ.jsp",true);xmlhttp.onreadystatechange=function()
{if(xmlhttp.readyState==4)
{}}
xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded');xmlhttp.send("watchUser="+user);}
var height=0;var status=0;function slowtoggledown(id,innerhtml)
{document.getElementById("message").style.display='block';document.getElementById("messagex").style.display='block';if(height<=14)
{height+=1;document.getElementById(id).style.height=height+'px';document.getElementById(id+"x").style.height=height+'px';if(status==0){setTimeout("slowtoggledown('"+id+"','"+innerhtml+"')",02);}}else{document.getElementById("message").innerHTML=innerhtml;status=1;}}
function slowtoggleup(id)
{document.getElementById("message").innerHTML="";document.getElementById("messagex").innerHTML="";if(height>0)
{height-=1;document.getElementById(id).style.height=height+'px';document.getElementById(id+"x").style.height=height+'px';if(status==1){setTimeout("slowtoggleup('"+id+"')",02);}}else{document.getElementById("message").style.display='none';document.getElementById("messagex").style.display='none';status=0;}}
ToondooScript.WatchUserViewPage=function(watchee){if(watchee!=""&&watchee!=null)
{document.getElementById("messagex").innerHTML="<a onclick=\"getElementById('message').style.display='block';slowtoggleup('message');\"><strong>X</strong></a>";slowtoggledown("message","<strong>Successfully added!</strong>");document.getElementById('watch').innerHTML="<a style='cursor: pointer;' class='bluetext' onclick=\"ToondooScript.UnwatchUserViewPage(userName);setTimeout('slowtoggleup(message)',3000);\"><img src='images/watchusermini.gif' border='0'> Remove from Watch list </a>";var xmlhttp=getXmlhttp();xmlhttp.open("POST","insertWatchUserViewpage.jsp",true);xmlhttp.onreadystatechange=function()
{if(xmlhttp.readyState==4)
{if(xmlhttp.responseText)
{document.getElementById('mes').innerHTML="We have added this Dooer to your watchlist.<br><br>Click <a href='http://toondoo.wiki.zoho.com/Using-the-ToonDoo-Website.html#Can%20I%20get%20updates%20whenever%20my%20favorite%20toondooers%20publish%20new%20toons?'>here</a> to learn more about Dooer Watching,<br> and the ToonFeed RSS.<br><br><a style='cursor:pointer;text-decoration:underline;' onclick=\"message.style.display='none';\"> Close </a> ";}}}
xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded');}else
{}}
ToondooScript.BlockUserComment=function(){var blockeduser=document.usernameform.userName.value;alert(blockeduser);if(blockeduser!=""&&blockeduser!=null)
{document.getElementById('blockcomuser').innerHTML="<a style='cursor: pointer;' class='bluetext' onclick=\"ToondooScript.UnblockUserFromComment();setTimeout('slowtoggleup(message)',3000);\"><img src='images/watchusermini.gif' border='0'> UnBlock From Comment </a>";var xmlhttp=getXmlhttp();xmlhttp.open("POST","blockUserFromCommenting.jsp",true);xmlhttp.onreadystatechange=function()
{if(xmlhttp.readyState==4)
{if(xmlhttp.responseText)
{alert(xmlhttp.responseText);}}}
xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded');xmlhttp.send("blockeduser="+blockeduser+"&action=block");}else
{}}
ToondooScript.UnblockUserFromComment=function()
{var unblockuser=document.usernameform.userName.value;alert(unblockuser);if(unblockuser!=""&&unblockuser!=null)
{document.getElementById('blockcomuser').innerHTML="<a style='cursor: pointer;' class='bluetext' onclick=\"ToondooScript.BlockUserComment();setTimeout('slowtoggleup(message)',3000);\"><img src='images/watchusermini.gif' border='0'> Block From Comment </a>";var xmlhttp=getXmlhttp();xmlhttp.open("POST","blockUserFromCommenting.jsp",true);xmlhttp.onreadystatechange=function()
{if(xmlhttp.readyState==4)
{if(xmlhttp.responseText)
{alert("response :: "+xmlhttp.responseText);}}}
alert("blockeduser="+unblockuser+"&action=unblock");xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded');xmlhttp.send("blockeduser="+unblockuser+"&action=unblock");}
else
{}}
ToondooScript.UnwatchUserViewPage=function(watchee){if(watchee!=""&&watchee!=null)
{document.getElementById("messagex").innerHTML="<a onclick=\"getElementById('message').style.display='block';slowtoggleup('message');\"><strong>X</strong></a>";slowtoggledown("message","<strong>Successfully removed</strong>");document.getElementById('watch').innerHTML="<a style='cursor: pointer;' class='bluetext' onclick=\"ToondooScript.WatchUserViewPage(userName);setTimeout('slowtoggleup(message)',3000);\"><img src='images/watchusermini.gif' border='0'> Add to Watch list </a>";var xmlhttp=getXmlhttp();xmlhttp.open("POST","dummy.jsp",true);xmlhttp.onreadystatechange=function()
{if(xmlhttp.readyState==4)
{if(xmlhttp.responseText)
{document.getElementById('mes').innerHTML="We have added this Dooer to your watchlist.<br><br>Click <a href='http://toondoo.wiki.zoho.com/Using-the-ToonDoo-Website.html#Can%20I%20get%20updates%20whenever%20my%20favorite%20toondooers%20publish%20new%20toons?'>here</a> to learn more about Dooer Watching,<br> and the ToonFeed RSS.<br><br><a style='cursor:pointer;text-decoration:underline;' onclick=\"message.style.display='none';\"> Close </a> ";}}}
xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded');}else
{}}
ToondooScript.addBookCheers=function(val,user,imgPath){message.style.display='block';document.getElementById('mes').innerHTML="Processing <br><img src='images/processing.gif'>";var xmlhttp=getXmlhttp();xmlhttp.open("POST","addBookCheers.toon",true);xmlhttp.onreadystatechange=function(){if(xmlhttp.readyState==4){
	document.getElementById('CheerId').style.display='none';
	if(xmlhttp.responseText)
{document.getElementById('mes').innerHTML="Thanks for cheering this one up! Time to feel good!";var t=setTimeout("message.style.display='none';",5000);}}}
xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded');xmlhttp.send("bookId="+val+"&user="+user+"&imgPath="+imgPath);}
ToondooScript.closeDiv=function(id,val){var ele=document.getElementById(id);document.getElementById(id).innerHTML=val;ele.style.display="none";}
ToondooScript.checklogin=function(val){var xmlhttp=getXmlhttp();xmlhttp.open("POST","checkLogin.toon",true);xmlhttp.onreadystatechange=function(){if(xmlhttp.readyState==4){if(xmlhttp.responseText.length>3){document.getElementById('msgSpan').innerHTML=xmlhttp.responseText;}
else{document.getElementById('msgSpan').innerHTML='';}}}
xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded');xmlhttp.send("loginName="+val);}
ToondooScript.addFavorites=function(val){message.style.display='block';document.getElementById('mes').innerHTML="Processing <br><img src='images/processing.gif'>";var xmlhttp=getXmlhttp();xmlhttp.open("POST","addFavorites.toon",true);xmlhttp.onreadystatechange=function(){if(xmlhttp.readyState==4)
{Element.hide("AddFav");if(xmlhttp.responseText)
{document.getElementById('mes').innerHTML="We have added this ToonDoo to your favourites!";var t=setTimeout("message.style.display='none';",5000)}}}
xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded');xmlhttp.send("toonId="+val);}
ToondooScript.addCheers=function(val,user){if(user!=""&&user!=null)
{document.getElementById('message').style.display='block';var xmlhttp=getXmlhttp();xmlhttp.open("POST","addCheers.toon",true);xmlhttp.onreadystatechange=function()
{if(xmlhttp.readyState==4)
{if(xmlhttp.responseText)
{document.getElementById('mes').innerHTML="Thanks for cheering this one up! Time to feel good!<br><br><a style='cursor:pointer;text-decoration:underline;' onclick=\"message.style.display='none';\"> Close </a>";var t=setTimeout("message.style.display='none';",5000);}}}
xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded');xmlhttp.send("toonId="+val+"&user="+user);}else
{}}
ToondooScript.addBookFavorites=function(val){message.style.display='block';document.getElementById('mes').innerHTML="Processing <br><img src='images/processing.gif'>";var xmlhttp=getXmlhttp();xmlhttp.open("POST","addBookFavorites.toon",true);xmlhttp.onreadystatechange=function(){if(xmlhttp.readyState==4){	
		document.getElementById('AddFav').style.display='none';
if(xmlhttp.responseText)
{document.getElementById('mes').innerHTML="We have added this ToonBook to your favourites!";var t=setTimeout("message.style.display='none';",5000)}}}
xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded');xmlhttp.send("bookId="+val);}
ToondooScript.addToBook=function(val){document.getElementById('message').style.display='block';document.getElementById('mes').innerHTML="Processing <br><img src='images/processing.gif'>";document.getElementById('book_'+val).style.visibility='hidden';var xmlhttp=getXmlhttp();xmlhttp.open("POST","addToBook.jsp",true);xmlhttp.onreadystatechange=function()
{if(xmlhttp.readyState==4)
{if(xmlhttp.responseText)
{document.getElementById('mes').innerHTML="This toon has been added to your Toon bag! <br><br><input class='groovybutton' type='button' value='View the bag!' onclick=\"document.getElementById(\'message\').style.display=\'none\';window.location.href='EditBook.toon'\">&nbsp;&nbsp;&nbsp;<input class='groovybutton'  type='button' value=' Not now!' onclick=\"document.getElementById(\'message\').style.display=\'none\';\">";document.getElementById('bookicon'+val).style.visibility='hidden';}}}
xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded');xmlhttp.send("toonId="+val+"&bookid=0");}
ToondooScript.addToBook=function(val,bookIcon){document.getElementById('message').style.display='block';document.getElementById('mes').innerHTML="Processing <br><img src='images/processing.gif'>";document.getElementById(bookIcon).src="images/spacer.gif";document.getElementById('book_'+val).style.visibility='hidden';var xmlhttp=getXmlhttp();xmlhttp.open("POST","addToBook.jsp",true);xmlhttp.onreadystatechange=function()
{if(xmlhttp.readyState==4)
{if(xmlhttp.responseText)
{document.getElementById('mes').innerHTML="This toon has been added to your Toon bag! <br><br><input class='groovybutton' type='button' value='View the bag!' onclick=\"document.getElementById(\'message\').style.display=\'none\';window.location.href='EditBook.toon'\">&nbsp;&nbsp;&nbsp;<input class='groovybutton'  type='button' value=' Not now!' onclick=\"document.getElementById(\'message\').style.display=\'none\';\">";}}}
xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded');xmlhttp.send("toonId="+val+"&bookid=0");}
ToondooScript.flagInapp=function(val,user,imgPath){document.getElementById('message').style.display='block';document.getElementById('mes').innerHTML="Processing <br><img src='images/processing.gif'>";var xmlhttp=getXmlhttp();xmlhttp.open("POST","flagInapp.toon",true);xmlhttp.onreadystatechange=function(){if(xmlhttp.readyState==4){if(xmlhttp.responseText)
{document.getElementById('mes').innerHTML="Thanks! The editors at ToonDoo have been alerted about this!";var t=setTimeout("message.style.display='none';",5000);}}}
xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded');xmlhttp.send("toonId="+val+"&user="+user+"&imgPath="+imgPath);}
ToondooScript.flagInapp=function(val,user){if(user!=""&&user!=null)
{document.getElementById('message').style.display='block';var xmlhttp=getXmlhttp();xmlhttp.open("POST","flagInapp.toon",true);xmlhttp.onreadystatechange=function()
{if(xmlhttp.readyState==4)
{if(xmlhttp.responseText)
{document.getElementById('mes').innerHTML="Thanks! The editors at ToonDoo have been alerted abouthis!<br><br><a style='cursor:pointer;text-decoration:underline;' onclick=\"message.style.display='none';\"> Close </a>";var t=setTimeout("message.style.display='none';",5000);}}}
xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded');xmlhttp.send("toonId="+val+"&user="+user);}else
{}}
ToondooScript.bookFlagInapp=function(val,user,imgPath){document.getElementById('message').style.display='block';document.getElementById('mes').innerHTML="Processing <br><img src='images/processing.gif'>";var xmlhttp=getXmlhttp();xmlhttp.open("POST","bookFlagInapp.toon",true);xmlhttp.onreadystatechange=function(){if(xmlhttp.readyState==4){if(xmlhttp.responseText)
{document.getElementById('mes').innerHTML="Thanks! The editors at ToonDoo have been alerted about this!";var t=setTimeout("document.getElementById('message').style.display='none';",5000);}}}
xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded');xmlhttp.send("bookId="+val+"&user="+user+"&imgPath="+imgPath);}
ToondooScript.makeBook=function(val,user,bookName,bookDesc,booktags,from,bookToonsAndStatus)
{if(bookName.length==0)
{document.getElementById('alert').style.display='block';document.getElementById('val').innerHTML="Please give a name to your book!<br><input type='button' class='grovybutton' value='Okay!' onclick=\"document.getElementById('alert').style.display='none';\">";}
else
{book.style.display='none';document.getElementById('alert').style.display='block';document.getElementById('val').style.innerHTML="Processing <br><img src='images/processing.gif'>";var xmlhttp=getXmlhttp();xmlhttp.open("POST","makeBook.toon",true);xmlhttp.onreadystatechange=function(){if(xmlhttp.readyState==4)
{if(xmlhttp.responseText)
{var url="ViewBook.toon?bookid="+xmlhttp.responseText;if(from=="make")
{document.getElementById('alert').style.display='block';document.getElementById('val').innerHTML="Now your book is ready to view! <br><a href='"+url+"'>view it here!</a><br><br><input type='button' class='grovybutton' value='Not Now!' onclick=\"document.getElementById('alert').style.display='none';\">";}
else if(from=="del")
{var t=setTimeout("document.getElementById('val').innerHTML='Selected Toons are removed from ToonBag!';",5000);}}}}}
xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded');xmlhttp.send("toonIds="+val+"&user="+user+"&bookname="+bookName+"&bookdesc="+bookDesc+"&booktags="+booktags+"&from="+from+"&toonIdsAndStatus="+bookToonsAndStatus);}
ToondooScript.sendBooksToFriend=function(form)
{
	var emailIds=form.emailIds.value;
	var senderName=form.senderName.value;
	var bookId=form.sendFriendbookId.value;
	var path=form.path.value;
	var booklink=form.booklink.value;
	var thumb=form.thumb.value;
	var sendtofriendContent=form.sendtofriendContent.value;
	document.getElementById("privshare").disabled=true;
	document.getElementById("privshare").value="Sending...";
	var xmlhttp=getXmlhttp();
	xmlhttp.open("POST","sendBook.toon",true);
	xmlhttp.onreadystatechange=function()
	{
		if(xmlhttp.readyState==4)
		{
			if(xmlhttp.responseText)
			{
/*				document.getElementById('message').style.display='block';
				document.getElementById('mes').innerHTML="Your ToonBook has been shared with your select group of friends!";
				var t=setTimeout("document.getElementById('message').style.display='none';",5000);
				document.getElementById("privshare").disabled=false;
				document.getElementById("privshare").value="Send";
*/
				jQuery("#messagesent").html("Your ToonBook has been shared with your select group of friends!");
				jQuery("#messagesent").show('slow');
				setTimeout("jQuery(\"#messagesent\").hide('slow')",5000);				
			//	document.getElementById('message').style.display='block';
			//	document.getElementById('mes').innerHTML="Your ToonDoo has been shared with your select group of friends!";
			//	var t=setTimeout("document.getElementById('message').style.display='none';",5000);				
				document.getElementById("privshare").disabled=false;
				document.getElementById("privshare").value="Send";
			}
		}
	}
	xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
	xmlhttp.send("emailIds="+emailIds+"&bookId="+bookId+"&senderName="+senderName+"&path="+path+"&booklink="+booklink+"&thumb="+thumb+"&sendtofriendContent="+sendtofriendContent);
}

ToondooScript.sendToFriend=function(form){
			
			var emailIds=form.emailIds.value;
			var senderName=form.senderName.value;
			var toonId=form.sendFriendtoonId.value;
			var path=form.path.value;
			var toonlink=form.toonlink.value;
			var thumb=form.thumb.value;
			var isPrivate=form.isPrivate.value;
			var toonAuthor = form.toonAuthor.value;
			var sendtofriendContent=form.sendtofriendContent.value;
			document.getElementById("privshare").disabled=true;
			document.getElementById("privshare").value="Sending...";
			var xmlhttp=getXmlhttp();
			//xmlhttp.open("POST","sendToFriendResponse.jsp",true);
			xmlhttp.open("POST","sendToFriend.toon",true);
			xmlhttp.onreadystatechange=function(){
				if(xmlhttp.readyState==4){
					jQuery("#messagesent").html("Your ToonDoo has been shared with your select group of friends!");
					jQuery("#messagesent").show('slow');
					setTimeout("jQuery(\"#messagesent\").hide('slow')",5000);				
				//	document.getElementById('message').style.display='block';
				//	document.getElementById('mes').innerHTML="Your ToonDoo has been shared with your select group of friends!";
				//	var t=setTimeout("document.getElementById('message').style.display='none';",5000);				
					document.getElementById("privshare").disabled=false;
					document.getElementById("privshare").value="Send";
					}
			}
		xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
	//	xmlhttp.send("emailIds="+emailIds+"&toonId="+toonId+"&senderName="+senderName+"&path="+path+"&toonlink="+toonlink+"&thumb="+thumb+"&userNames="+userNames+"&toonAuthor="+toonAuthor+"&sendtofriendContent="+sendtofriendContent);
		xmlhttp.send("emailIds="+emailIds+"&toonId="+toonId+"&senderName="+senderName+"&path="+path+"&toonlink="+toonlink+"&thumb="+thumb+"&toonAuthor="+toonAuthor+"&sendtofriendContent="+sendtofriendContent+"&isPrivate="+isPrivate);
		}

ToondooScript.inviteFriends=function(form){var emailIds=form.emailIds.value;var senderName=form.senderName.value;var sendtofriendContent=form.sendtofriendContent.value;if(emailIds.length==0)
{document.getElementById('message').style.display='block';document.getElementById('mes').innerHTML="Please fill the mail addresses to invite!";var t=setTimeout("document.getElementById('message').style.display='none';",3000)
form.emailIds.focus();}
else
{document.getElementById("button").disabled=true;document.getElementById("button").value="Sending...";var xmlhttp=getXmlhttp();xmlhttp.open("POST","inviteFriendsMail.jsp",true);xmlhttp.onreadystatechange=function(){if(xmlhttp.readyState==4){document.getElementById("button").disabled=false;document.getElementById("button").value="Submit";document.getElementById('message').style.display='block';document.getElementById('mes').innerHTML="Your friends have been invited to ToonDoo!";var t=setTimeout("document.getElementById('message').style.display='none';",3000)}}}
xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded');xmlhttp.send("sName="+senderName+"&MailIds="+emailIds+"&message="+sendtofriendContent);}
ToondooScript.sendPrivateShare=function(form){var senderName=form.senderName.value;var sEmail=form.senderEmail.value;var privateMailIds=form.privateMailIds.value;var toonId=form.toonId.value;document.getElementById("privshare").disabled=true;document.getElementById("privshare").value="Sending...";var xmlhttp=getXmlhttp();xmlhttp.open("POST","privateShareMail.jsp",true);xmlhttp.onreadystatechange=function(){if(xmlhttp.readyState==4){document.getElementById("privshare").disabled=false;document.getElementById("privshare").value="Submit";form.privateMailIds.value="";document.getElementById('message').style.display='block';document.getElementById('mes').innerHTML="Your ToonDoo has been shared with your select group of friends!";var t=setTimeout("document.getElementById('message').style.display='none';",5000)}}
xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded');xmlhttp.send("sName="+senderName+"&privateMailIds="+privateMailIds+"&sEmail="+sEmail+"&toonId="+toonId);}
ToondooScript.updateStatus=function(form)
{var txt="";var rad=form.toonstat.length;var url,senderName,sEmail,privateMailIds,params,toonId,callFile=0,loc,enc;toonId=form.toonId.value;var allowredoo=0;if(form.allowremix.checked==true)
{allowredoo=2;}
enc=form.loc.value;var xmlhttp=getXmlhttp();for(var i=0;i<rad;i++)
{if(form.toonstat[i].checked)
{var toonstat=form.toonstat[i].value;}}
if(toonstat=="shared")
{txt="Your ToonDoo has been shared with your select group of friends!";url="privateShareMail.jsp";senderName=form.senderName.value;sEmail=form.senderEmail.value;privateMailIds=form.privateMailIds.value;if(privateMailIds.length==0)
{alert("Please enter Email Id");form.privateMailIds.focus();callFile=1;}
loc="privateView.toon?param="+enc;params="sName="+senderName+"&privateMailIds="+privateMailIds+"&sEmail="+sEmail+"&toonId="+toonId+"&allowremix="+allowredoo;}
if(toonstat=="publish")
{txt="Your ToonDoo's status has been updated!";url="updateToonDetails.jsp";params="toonstat="+toonstat+"&toonId="+toonId+"&allowremix="+allowredoo;loc="View.toon?param="+toonId;}
if(toonstat=="private")
{txt="Your ToonDoo's status has been updated!";url="updateToonDetails.jsp";params="toonstat="+toonstat+"&toonId="+toonId+"&allowremix="+allowredoo;loc="privateView.toon?param="+enc;}
if(callFile==0)
{document.getElementById("privshare").disabled=true;document.getElementById("privshare").value="Sending...";xmlhttp.open("POST",url,true);xmlhttp.onreadystatechange=function()
{if(xmlhttp.readyState==4)
{document.getElementById("privshare").disabled=false;document.getElementById("privshare").value="Send";document.getElementById('message').style.display='block';document.getElementById('mes').innerHTML=txt;var t=setTimeout("document.getElementById('message').style.display='none';",5000);}}
xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded');xmlhttp.send(params);}}
ToondooScript.updateToonDetails=function(form){var toondesc=form.toondesc.value;var tagName=form.tagName.value;var toonId=form.toonId.value;document.getElementById("update").disabled=true;document.getElementById("update").value="Updating...";var xmlhttp=getXmlhttp();xmlhttp.open("POST","updateToonDetails.jsp",true);xmlhttp.onreadystatechange=function(){if(xmlhttp.readyState==4)
{document.getElementById("update").disabled=false;document.getElementById("update").value="Update";document.getElementById('message').style.display='block';document.getElementById('mes').innerHTML="Your changes have been updated!";var t=setTimeout("document.getElementById('message').style.display='none';",5000);}}
xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded');xmlhttp.send("toondesc="+toondesc+"&tagName="+tagName+"&toonId="+toonId);}
ToondooScript.updateBookDetails=function(form){var bookdesc=form.bookdesc.value;var tagName=form.booktags.value;var bookId=form.bookId.value;document.getElementById("update").disabled=true;document.getElementById("update").value="Updating...";var xmlhttp=getXmlhttp();xmlhttp.open("POST","updateBookDetails.jsp",true);xmlhttp.onreadystatechange=function(){if(xmlhttp.readyState==4)
{document.getElementById("update").disabled=false;document.getElementById("update").value="Update";document.getElementById('message').style.display='block';document.getElementById('mes').innerHTML="Your changes have been updated!";var t=setTimeout("document.getElementById('message').style.display='none';",5000);}}
xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded');xmlhttp.send("bookdesc="+bookdesc+"&tagName="+tagName+"&bookId="+bookId);}
ToondooScript.editBookPages=function(form){var bookdesc=form.bookdesc.value;var tagName=form.booktags.value;var bookId=form.bookId.value;var toonIds=form.toonIds.value;var bookname=form.bookname.value;var toonsInBook=form.toonsInBook.value;var bookToonsAndStatus=form.toonIdsAndStatus.value;document.getElementById("update").disabled=true;document.getElementById("update").value="Updating...";var xmlhttp=getXmlhttp();xmlhttp.open("POST","editBookPages.jsp",true);xmlhttp.onreadystatechange=function(){if(xmlhttp.readyState==4)
{document.getElementById("update").disabled=false;document.getElementById("update").value="Update";var url="ViewBook.toon?bookid="+bookId;document.getElementById('book').style.display='none';document.getElementById('alert').style.display='block';document.getElementById('val').innerHTML=bookname+" book has been updated!<br><br> <a href='"+url+"'>View it here!</a><br><input type='button' value='Not Now!' onClick=\"document.getElementById('alert').style.display='none';\">";}}
xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded');xmlhttp.send("bookId="+bookId+"&toonsInBook="+toonsInBook+"&toonIds="+toonIds+"&bookdesc="+bookdesc+"&booktags="+tagName+"&toonIdsAndStatus="+bookToonsAndStatus);}
ToondooScript.addComment=function(form){var toonId=form.toonId.value;var commentText=form.commentsText.value;var toonAuthor=form.toonAuthor.value;var toonStatus=form.toonStatus.value;res='';if(commentText.length<1){commentText='Default - Comment';}
else{commentText=commentText.split("\n");for(var i=0;i<commentText.length;i++){res+=commentText[i]+'\\n';}
commentText=res;}
document.getElementById("comment").disabled=true;document.getElementById("comment").value="Sending...";var xmlhttp=getXmlhttp();xmlhttp.open("POST","addComment.toon",true);xmlhttp.onreadystatechange=function(){if(xmlhttp.readyState==4)
{document.getElementById("comment").disabled=false;document.getElementById("comment").value="Submit";form.commentsText.value="";new Insertion.Bottom('showyourcomment',xmlhttp.responseText);}}
xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded');xmlhttp.send("toonId="+toonId+"&commentText="+commentText+"&toonAuthor="+toonAuthor+"&toonStatus="+toonStatus);}
ToondooScript.addBookComment=function(form){var toonId=form.bookId.value;var bookAuthor=form.bookAuthor.value;var commentText=form.commentsText.value;res='';if(commentText.length<1){commentText='Default - Comment';}
else{commentText=commentText.split("\n");for(var i=0;i<commentText.length;i++){res+=commentText[i]+'\\n';}
commentText=res;}
document.getElementById("comment").disabled=true;document.getElementById("comment").value="Sending...";var xmlhttp=getXmlhttp();xmlhttp.open("POST","addBookComment.toon",true);xmlhttp.onreadystatechange=function()
{if(xmlhttp.readyState==4)
{document.getElementById("comment").disabled=false;document.getElementById("comment").value="Submit";form.commentsText.value="";new Insertion.Bottom('comments',xmlhttp.responseText);}}
xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded');xmlhttp.send("bookId="+toonId+"&commentText="+commentText+"&bookAuthor="+bookAuthor);}
function deleteToon(toonId,val)
{msgbox.style.display='block';var hiddenVal;if(val=='Yes')
{msgbox.style.display='none';hiddenVal=toonId;var xmlhttp=getXmlhttp();xmlhttp.open("POST","updateToonDetails.jsp",true);xmlhttp.onreadystatechange=function()
{if(xmlhttp.readyState==4)
{document.getElementById('message').style.display='block';document.getElementById('mes').innerHTML="This toon has been Deleted!";var t=setTimeout("document.getElementById('message').style.display='none';closeDialog();",3000)
document.location.reload();}}
xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded');xmlhttp.send("toonId="+hiddenVal+"&from=deleteToon");}}
function deleteBook(bookId,val)
{document.getElementById('msgbox').style.display='block';var hiddenVal;if(val=='Yes')
{document.getElementById('msgbox').style.display='none';hiddenVal=bookId;var xmlhttp=getXmlhttp();xmlhttp.open("POST","updateBookDetails.jsp",true);xmlhttp.onreadystatechange=function()
{if(xmlhttp.readyState==4)
{if(xmlhttp.responseText)
{document.getElementById('message').style.display='block';var t=setTimeout("document.getElementById('message').style.display = 'none';closeDialog();",3000);document.getElementById('mes').innerHTML="This toonBook has been Deleted!";document.location.reload();}}}
xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded');xmlhttp.send("bookId="+hiddenVal+"&from=deleteToon");}}
ToondooScript.delToonBag=function(toonId,authName){var xmlhttp=getXmlhttp();xmlhttp.open("POST","delToonBag.jsp",true);document.getElementById('delmes').innerHTML="Processing <br><img src='images/processing.gif'>";xmlhttp.onreadystatechange=function(){if(xmlhttp.readyState==4){document.getElementById('delmes').innerHTML="Your toon has been deleted from toon bag!";var t=setTimeout("del.style.display='none';",5000);window.location.href="EditBook.toon";}}
xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded');xmlhttp.send("toonIds="+toonId+"&authName="+authName);}
ToondooScript.delComment=function(commentId,toonId)
{document.getElementById(commentId).style.display='none';var xmlhttp=getXmlhttp();xmlhttp.open("POST","delComment.toon",true);document.getElementById('delmes').innerHTML="Processing <br><img src='images/processing.gif'>";xmlhttp.onreadystatechange=function()
{if(xmlhttp.readyState==4)
{document.getElementById('delmes').innerHTML="Your comment has been deleted successfully!";var t=setTimeout("delcomment.style.display='none';",5000);}}
xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded');xmlhttp.send("commentId="+commentId+"&toonId="+toonId);}
ToondooScript.delBookComment=function(commentId,bookId)
{document.getElementById(commentId).style.display='none';var xmlhttp=getXmlhttp();xmlhttp.open("POST","delBookCommentResponse.jsp",true);document.getElementById('delmes').innerHTML="Processing <br><img src='images/processing.gif'>";xmlhttp.onreadystatechange=function()
{if(xmlhttp.readyState==4)
{document.getElementById('delmes').innerHTML="Your comment has been deleted successfully!";var t=setTimeout("delcomment.style.display='none';",5000);}}
xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded');xmlhttp.send("commentId="+commentId+"&bookId="+bookId);}
ToondooScript.sendPrivateMsg=function(form)
{
	var toName=form.toName.value;
	var sName=form.senderName.value;
	var message=form.message.value;
	var type = "";
	if(form.type.value != null)
	{
		type = form.type.value;
	}
	if(message.length<1){alert("Message shouldn't be empty !!");}
else
{document.getElementById("send").disabled=true;document.getElementById("send").value="Sending...";var xmlhttp=getXmlhttp();xmlhttp.open("POST","SNSendMsg.jsp",true);xmlhttp.onreadystatechange=function()
{if(xmlhttp.readyState==4)
{document.getElementById("send").disabled=false;document.getElementById("send").value="Send";document.getElementById("msgBox").style.display='block';var t=setTimeout("msgBox.style.display='none';",5000);}}
xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded');xmlhttp.send("from="+sName+"&msg="+message+"&to="+toName+"&type="+type);
form.message.value = '';}}
ToondooScript.PrivateMsgForm=function(sender,to)
{document.getElementById('orignialmsg').innerHTML="<form name='privatemsgform'>To : <b>"+to+"<input type='hidden' value='"+to+"' name='toName'><input type='hidden' value='"+sender+"' name='senderName'></b><br>Message :<br><textarea rows=\"4\" cols=\"24\" name=\"message\"></textarea><br> <center><input type=\"button\" value=\"Send\" id=\"send\" onclick=ToondooScript.sendPrivateMsg(this.form);><input type=\"button\" value=\"Cancel\" name=\"cancel\" onclick=\"document.getElementById('privateMsg').style.display='none;'\"></center></form>";}

ToondooScript.sendFeedback=function(form)
{
		var senderName=form.senderName.value;
		var sEmail=form.senderEmail.value;
		var feedbackContent=form.feedbackContent.value;
		if(sEmail.length< 5  )
		{
		  alert("Please enter your email address for us to get back to you!");
		  form.senderEmail.focus();
		}
		else
		if(feedbackContent.length<1)
		{
			alert("Mail Content shouldn't be empty !!");
		}
		else
		{
			if(senderName.length < 3)
			{
				senderName = 'Visitor';
			}
			feedbackContent=feedbackContent+"<br><br>Page Referer: "+document.location.href+"<br>";
			var xmlhttp=getXmlhttp();
			xmlhttp.open("POST","feedback.jsp",true);
			xmlhttp.onreadystatechange=function(){
				if(xmlhttp.readyState==4){
					form.senderName.value="";
					form.feedbackContent.value="";
					form.senderEmail.value="";
					closeDialog();
					}
				}
				xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
				xmlhttp.send("sName="+senderName+"&content="+feedbackContent+"&sEmail="+sEmail);
		}
}

ToondooScript.ajaxLogin=function(form)
{

	document.getElementById("signin").disabled=true;
	document.getElementById("signin").value="Sending...";
	//alert("test");
	//alert("form :: "+form.j_username.value);
	var uname=form.j_username.value;
	var pass=form.j_password.value;
	var redirect=form.redirect.value;
	//alert(uname+"--"+pass+"--"+redirect);
	var xmlhttp=getXmlhttp();
	var result="";
	xmlhttp.open("POST","/j_security_check",true);
	xmlhttp.onreadystatechange=function(){
		if(xmlhttp.readyState==4)
		{
			result=xmlhttp.responseText;
			//alert("result :: "+result);
			result=result.substring(0,14);
			if(result=="<!--Invalid-->")
			{
			document.getElementById('invalid').innerHTML='Invalid Login';
			document.getElementById('invalid').style.display='block';
			blinkBox(document.getElementById("invalid"));
			document.getElementById("signin").disabled=false;
			document.getElementById("signin").value=" Sign In ";
			}
			else
			{
			window.top.location.href=redirect;
			}
		}
	}
	xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
	xmlhttp.send("j_username="+uname+"&j_password="+pass);
	return false;
}

/*
ToondooScript.ajaxLogin=function(form)
{document.getElementById("signin").disabled=true;document.getElementById("signin").value="Sending...";var uname=form.j_username.value;var pass=form.j_password.value;var redirect=form.redirect.value;var xmlhttp=getXmlhttp();var result="";xmlhttp.open("POST","/j_security_check",true);xmlhttp.onreadystatechange=function()
{if(xmlhttp.readyState==4)
{result=xmlhttp.responseText;
	alert("result :: "+result);
	result=result.substring(0,14);if(result=="<!--Invalid-->")
{document.getElementById('invalid').innerHTML='Invalid Login';document.getElementById('invalid').style.display='block';blinkBox(document.getElementById("invalid"));document.getElementById("signin").disabled=false;document.getElementById("signin").value=" Sign In ";}
else
{window.top.location.href=redirect;}}}
xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded');xmlhttp.send("j_username="+uname+"&j_password="+pass);return false;}

*/
ToondooScript.ajaxReg=function(form)
{
document.getElementById("signup").disabled=true;
document.getElementById("signup").value="Sending...";
var uname=form.j_username.value;
var pass=form.j_password.value;
var email=form.j_emailid.value;
var redirect=form.redirect.value;
if(uname.length == 0)
{
	document.getElementById("invalid2").innerHTML='Username must be filled out!';
	document.getElementById("invalid2").style.display="block";
	blinkBox(document.getElementById("invalid2"));
	//alert('Username must be filled out!');
	document.getElementById("signup").disabled=false;
	document.getElementById("signup").value=" Sign Up ";
     	return false;
}
if(uname.length < 3)
{
	document.getElementById("invalid2").innerHTML='Username needs to have atleast 3 letters!';
	document.getElementById("invalid2").style.display="block";
	blinkBox(document.getElementById("invalid2"));
	//alert('Username needs to have atleast 3 letters!');
	document.getElementById("signup").disabled=false;
	document.getElementById("signup").value=" Sign Up ";
     	return false;
}
if(pass.length == 0)
{
	document.getElementById("invalid2").innerHTML='Password must be filled out!';
	document.getElementById("invalid2").style.display="block";
	blinkBox(document.getElementById("invalid2"));
	//alert('Password must be filled out!');
	document.getElementById("signup").disabled=false;
	document.getElementById("signup").value=" Sign Up ";
     	return false;
}
if(pass.length < 5)
{
	document.getElementById("invalid2").innerHTML='Password needs to have atleast 5 letters!';
	document.getElementById("invalid2").style.display="block";
	blinkBox(document.getElementById("invalid2"));
	//alert('Password needs to have atleast 5 letters!');
	document.getElementById("signup").disabled=false;
	document.getElementById("signup").value=" Sign Up ";
     	return false;
}
if(email.length == 0) {
	document.getElementById("invalid2").innerHTML='Email must be filled out!';
	document.getElementById("invalid2").style.display="block";
	blinkBox(document.getElementById("invalid2"));
      	//alert('Email must be filled out!');
	document.getElementById("signup").disabled=false;
	document.getElementById("signup").value=" Sign Up ";
     	return false;
}
var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
if(reg.test(email) == false) {
	document.getElementById("invalid2").innerHTML='Your email address seems incorrect. Please try again.';
	document.getElementById("invalid2").style.display="block";
	blinkBox(document.getElementById("invalid2"));
      	//alert('Your email address seems incorrect. Please try again.');
	document.getElementById("signup").disabled=false;
	document.getElementById("signup").value=" Sign Up ";
     	return false;
}
var xmlhttp=getXmlhttp();
var result="";
xmlhttp.open("POST","/createUserPopup.jsp",true);
xmlhttp.onreadystatechange=function()
{if(xmlhttp.readyState==4)
{result=xmlhttp.responseText;
result=result;
if(result.replace(/^\s+|\s+$/g, "")=="user created...")
{
	setTimeout(ToondooScript.ajaxLogin(form),2000);
}
else
{
document.getElementById("invalid2").innerHTML=result;
document.getElementById("invalid2").style.display="block";
blinkBox(document.getElementById("invalid2"));
document.getElementById("signup").disabled=false;
document.getElementById("signup").value=" Sign Up ";
}}}
xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
xmlhttp.send("j_username="+uname+"&j_password="+pass+"&j_emailid="+email);
return false;

}
function blinkBox(n) {
     //var n = document.getElementById('myTbox');
     var t = 6;
     var b = 0;
     var c = [ 'red', 'white' ,'blue'];
  
     var i = window.setInterval(function() {
         n.style.color = 
             n.style.color != c[1] ? c[1] : c[0];
  	
         b++;
  
         if (b == t) {
             window.clearInterval(i);
         }
     }, 500);
}
ToondooScript.changeMail=function(newEmail,userId)
{var xmlhttp=getXmlhttp();xmlhttp.open("POST","changeEmail.jsp",true);xmlhttp.onreadystatechange=function(){if(xmlhttp.readyState==4)
{document.getElementById('message').style.display='block';document.getElementById('mes').innerHTML=xmlhttp.responseText;var t=setTimeout("document.getElementById('message').style.display='none';",5000)}}
xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded');xmlhttp.send("sEmail="+newEmail+"&userId="+userId);}

/*ToondooScript.Sendtofriend=function(form){var senderName=form.senderName.value;var sEmail=form.senderEmail.value;var toonlink=form.toonlink.value;var sendtofriendContent=form.sendtofriendContent.value;var thumb=form.thumb.value;if(senderName.length<1){senderName='Nil';}
if(sEmail.length<1){sEmail='admin@toondoo.com';}
else{if(sEmail.indexOf('@')>0){}
else{sEmail='admin@toondoo.com';}}
var xmlhttp=getXmlhttp();xmlhttp.open("POST","sendToFriend.toon",true);xmlhttp.onreadystatechange=function(){if(xmlhttp.readyState==4){form.senderName.value="";form.toonlink.value="";form.sendtofriendContent.value="";form.senderEmail.value="";form.thumb.value="";alert(xmlhttp.responseText);closeDialog();}}
xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded');xmlhttp.send("thumb="+thumb+"&toonlink="+toonlink+"&sName="+senderName+"&content="+sendtofriendContent+"&sEmail="+sEmail);}
*/
function findPosX(obj){var curleft=0;if(obj.offsetParent){while(1){curleft+=obj.offsetLeft;if(!obj.offsetParent){break;}
obj=obj.offsetParent;}}else if(obj.x){curleft+=obj.x;}
return curleft;}
function findPosY(obj){var curtop=0;if(obj.offsetParent){while(1){curtop+=obj.offsetTop;if(!obj.offsetParent){break;}
obj=obj.offsetParent;}}else if(obj.y){curtop+=obj.y;}
return curtop;}
function getXmlhttp(){if(window.XMLHttpRequest){var xmlhttp=new XMLHttpRequest();}else{try{var xmlhttp=new ActiveXObject('Microsoft.XMLHTTP');}catch(ee){try{var xmlhttp=new ActiveXObject('Microsoft.XMLDOM');}catch(e){var xmlhttp=new ActiveXObject('Msxml2.XMLHTTP');}}}
return xmlhttp;}
function validateSearchText()
{var searchText=document.getElementById("searchText").value;var stext=searchText.replace(/^\s+/,'');if(stext.length<3)
{document.getElementById("searchText").value="Min 3 Chars!";return false;}
return true;}
function shareIt()
{if(eval("document.toonstat.checked")==true)
{document.privshare.disabled=false;}
else
{document.privshare.disabled=true;}}
function ajaxSignin()
{document.getElementById("ajaxlogin").style.display="block";document.getElementById("ajaxreg").style.display="none";document.ajaxloginform.j_username.focus();}
function ajaxSignup()
{document.getElementById("ajaxlogin").style.display="none";document.getElementById("ajaxreg").style.display="block";document.ajaxregform.j_username.focus();}
function ajaxLoginFocus()
{document.ajaxloginform.j_username.focus();}
function ajaxRegFocus()
{document.ajaxregform.j_username.focus();}
function alphaNumericOnly(i)
{if(i.value.length>0)
{i.value=i.value.replace(/[\W]+/g,'');}}
function handleKeyPress(evt){var nbr;var nbr=(window.event)?event.keyCode:evt.which;if(nbr==13)
{ToondooScript.ajaxLogin(document.ajaxloginform);}
else return true;}

//toondoo-shop functions
/*
function userFileRead(incpath,p_toon_id,p_author_name) // for toondoo-shop app
{
	
	var xmlhttp;  // The variable that makes Ajax possible!
	try
	{
		// Opera 8.0+, Firefox, Safari
		xmlhttp = new XMLHttpRequest();
	}
	catch (e)
	{
		// Internet Explorer Browsers
		try
		{
			xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch (e) 
		{
			try
			{
				xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
			} 
			catch (e)
			{
				// Something went wrong
				alert("Your browser broke!");
				//return false;
			}
		}
	}
	if (xmlhttp!=null)
	{
		xmlhttp.open("GET", incpath , true);
		xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
		xmlhttp.send(null);
		xmlhttp.onreadystatechange = function()
		{
			if (xmlhttp.readyState == 4) 
			{
				responseData = xmlhttp.responseText;
				responseData = responseData.replace("&udata=","");
				var responseArray = responseData.split('±');
				alert(responseArray.length);
				highResAction(p_toon_id,p_author_name,responseArray[27],responseArray[28]);
				
			}
		}
	}
	else
	{
		alert("Your browser does not support XMLHTTP.");
	}
} */
//for toondoo-shop application
function toondootracker(to,event)
{
	var removePageNo = location.href.replace(/[0-9]/g,"");
	var url=removePageNo.replace(/#/g,"");
	url=url.replace("http://www.toondoo.com/","").replace("http://testbed.localtoondoo.com/","");
	from=url;
	action_data="locfrom=toondoo&locto=toondoo&from="+from+"&to="+to+"&event="+event;
	jQuery.ajax({
		type: "POST",	
		url:"insertinToonDooAnalytic.jsp",
		data: action_data,success: function(msg){ window.location=to;}
	});
	//alert(action_data);
	
}
