////////////////////////////////////////////////
// Obfuscated by Javascript Obfuscator v.2.53 //
//        http://javascript-source.com        //
////////////////////////////////////////////////
function load_photocloud_aj(num_items,per_page,start_item)// by syu 2/2008
{start_item=start_item?start_item:0;xmlhttp=(window.XMLHttpRequest?new XMLHttpRequest():((window.ActiveXObject)?new ActiveXObject("Microsoft.XMLHTTP"):null));if(xmlhttp){//xmlhttp.onreadystatechange=state_change_catlist
xmlhttp.open("POST",'photocloud_aj.php?',false)// added 12/2007 by syu to make url unique for ajax smarty
;xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded');xmlhttp.send('&num_items='+num_items+'&per_page='+per_page+'&start='+start_item)}document.getElementById("mainBodyDiv").innerHTML=xmlhttp.responseText;}function load_catlist_content_cattype_aj(num_items,per_page,start_item,category_id,cat_type,sortBy){/*if ( document.getElementById("select_cat_type").selectedIndex == 0 ) cat_type = '';	else if ( document.getElementById("select_cat_type").selectedIndex == 1 ) cat_type = 'newest';	else if ( document.getElementById("select_cat_type").selectedIndex == 2 ) cat_type = 'bestrated';*///alert(cat_type+','+ num_items+', '+per_page+', '+start_item+', '+category_id);
start_item=start_item?start_item:0;if(category_id>0)document.forms["form2"].elements["cat_id"].value=category_id;else if(document.forms["form2"].elements["cat_id"].value>0)category_id=document.forms["form2"].elements["cat_id"].value;xmlhttp=(window.XMLHttpRequest?new XMLHttpRequest():((window.ActiveXObject)?new ActiveXObject("Microsoft.XMLHTTP"):null));if(xmlhttp){//xmlhttp.onreadystatechange=state_change_catlist
xmlhttp.open("POST",'category_listing_aj.php?'+category_id+sortBy,false)// added 12/2007 by syu to make url unique for ajax smarty
;xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded');xmlhttp.send('cat_type='+cat_type+'&num_items='+num_items+'&per_page='+per_page+'&start='+start_item+'&category_id='+category_id+'&sortBy='+(sortBy?sortBy:''))}document.getElementById("mainBodyDiv").innerHTML=xmlhttp.responseText;}function load_catlist_content_cattype_aj_alphabet(category_id,firstname,sortBy)// searching by alphabet by syu 1/2008
{xmlhttp=(window.XMLHttpRequest?new XMLHttpRequest():((window.ActiveXObject)?new ActiveXObject("Microsoft.XMLHTTP"):null));if(xmlhttp){//xmlhttp.onreadystatechange=state_change_catlist
xmlhttp.open("POST",'category_listing_aj.php?'+category_id+firstname,false)// added 12/2007 by syu to make url unique for ajax smarty
;xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded');xmlhttp.send('category_id='+category_id+'&firstname='+firstname+'&sortBy=alphabet')}document.getElementById("mainBodyDiv").innerHTML=xmlhttp.responseText;// endAjaxIndicator();
}function load_catlist_content_author_aj(num_items,per_page,start_item,firstname,cat_type){/*if ( document.getElementById("select_cat_type").selectedIndex == 0 ) cat_type = '';	else if ( document.getElementById("select_cat_type").selectedIndex == 1 ) cat_type = 'newest';	else if ( document.getElementById("select_cat_type").selectedIndex == 2 ) cat_type = 'bestrated';*///alert(cat_type+','+ num_items+', '+per_page+', '+start_item+', '+category_id);
start_item=start_item?start_item:0;xmlhttp=(window.XMLHttpRequest?new XMLHttpRequest():((window.ActiveXObject)?new ActiveXObject("Microsoft.XMLHTTP"):null));if(xmlhttp){//xmlhttp.onreadystatechange=state_change_catlist
xmlhttp.open("POST",'author_listing_aj.php?'+firstname,false)// added 12/2007 by syu to make url unique for ajax smarty
;xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded');xmlhttp.send('cat_type='+cat_type+'&num_items='+num_items+'&per_page='+per_page+'&start='+start_item+'&firstname='+firstname);}document.getElementById("mainBodyDiv").innerHTML=xmlhttp.responseText;}function show_full_image(image_id){//alert(num_items+', '+per_page+', '+start_item+', '+category_id);
xmlhttp=(window.XMLHttpRequest?new XMLHttpRequest():((window.ActiveXObject)?new ActiveXObject("Microsoft.XMLHTTP"):null));if(xmlhttp){xmlhttp.onreadystatechange=state_change_full_image;xmlhttp.open("POST",'show_full_image_aj.php',false);xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded');xmlhttp.send('image_id='+image_id)}document.getElementById(aid_val).className="inactive1";document.getElementById("last_clicked").value=category_id;document.getElementById("mainBodyDiv").innerHTML=xmlhttp.responseText;}function state_change_full_image(){if(xmlhttp.readyState==4){}}function load_catlist_content_aj(num_items,per_page,start_item,category_id,sortBy){//alert(num_items+', '+per_page+', '+start_item+', '+category_id);
if(category_id>0)document.forms["form2"].elements["cat_id"].value=category_id;else if(document.forms["form2"].elements["cat_id"].value>0)category_id=document.forms["form2"].elements["cat_id"].value;xmlhttp=(window.XMLHttpRequest?new XMLHttpRequest():((window.ActiveXObject)?new ActiveXObject("Microsoft.XMLHTTP"):null));if(xmlhttp){xmlhttp.onreadystatechange=state_change_catlist;xmlhttp.open("POST",'category_listing_aj.php',false);xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded');xmlhttp.send('num_items='+num_items+'&per_page='+per_page+'&start='+start_item+'&category_id='+category_id+'&sortBy='+(sortBy?sortBy:''));}aid_val="aid_"+category_id;if(document.getElementById("last_clicked").value!=''){last_aid="aid_"+document.getElementById("last_clicked").value;document.getElementById(last_aid).className="active1";}document.getElementById(aid_val).className="inactive1";document.getElementById("last_clicked").value=category_id;document.getElementById("mainBodyDiv").innerHTML=xmlhttp.responseText;// endAjaxIndicator();
}function state_change_catlist(){if(xmlhttp.readyState==4){}}function category_reset(){document.forms["form2"].elements["cat_id"].value='';}function load_ajax_content_aj(num_items,per_page,start_item,category_id,user_id,sortBy){xmlhttp=(window.XMLHttpRequest?new XMLHttpRequest():((window.ActiveXObject)?new ActiveXObject("Microsoft.XMLHTTP"):null));if(xmlhttp){xmlhttp.onreadystatechange=function(){if(xmlhttp.readyState==4){}};xmlhttp.open("POST",'index_aj.php?page='+start_item,false);xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded');xmlhttp.send('user_id='+user_id+'&num_items='+num_items+'&per_page='+per_page+'&start_item='+start_item+'&category_id='+category_id+'&sortBy='+(sortBy?sortBy:''))}document.getElementById("mainBodyDiv").innerHTML=xmlhttp.responseText;// endAjaxIndicator();
}function state_change(){if(xmlhttp.readyState==4){}}function confirm_delete(){var val;val=confirm("Do you want to delete?");return val;}function set_focus_login(){document.getElementById("name").setfocus=true;}function email_check(){var emailchar=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i;if(emailchar.test(document.getElementById("email").value)){return true}else{alert("Please, enter a valid email address.");}};function show_logo(){document.getElementById('logodiv').style.visibility='visible';document.getElementById('logodiv').style.display='block';document.all.logo.src=document.all.userfile.value;}function show_popup(str){var arg='resizable=yes, toolbar=no,location=no,directories=no,addressbar=no,scrollbars=yes,status=no,menubar=no,width=780,top=20,left=0';window.open(str,"_blank",arg);}function startAjaxIndicator(dv,nt,pp,st,ci,ui,sr){//	document.getElementById('disabledImageZone').style.display = 'block';
//	document.getElementById('loaderContainer').style.display = 'block';
document.getElementById('loaderContainer').innerHTML="<img src='./img/loading.gif' align='absmiddle'>";// by syu
setTimeout("category_reset();load_ajax_content_aj('"+dv+"', '"+nt+"', '"+pp+"', '"+st+"', '"+ci+"', '"+ui+"', '"+sr+"');",30);}function endAjaxIndicator(){//	document.getElementById('disabledImageZone').style.display = 'none';
document.getElementById('loaderContainer').style.display='none';}function startAjaxIndicator2(nt,pp,st,ci,dv,sr){//	document.getElementById('disabledImageZone').style.display = 'block';
//	document.getElementById('loaderContainer').style.display = 'block';
document.getElementById('loaderContainer').innerHTML="<img src='./img/loading.gif' align='absmiddle'>";// by syu
setTimeout("load_catlist_content_cattype_aj('"+nt+"', '"+pp+"', '"+st+"', '"+ci+"', '"+dv+"', '"+sr+"');",10);}function startAjaxIndicator_author(nt,pp,st,ci,dv,sr){//	document.getElementById('disabledImageZone').style.display = 'block';
//	document.getElementById('loaderContainer').style.display = 'block';
document.getElementById('loaderContainer').innerHTML="<img src='./img/loading.gif' align='absmiddle'>";// by syu
setTimeout("load_catlist_content_author_aj('"+nt+"', '"+pp+"', '"+st+"', '"+ci+"', '"+dv+"', '"+sr+"');",10);}function startAjaxIndicator3(nt,pp,st,ci){//	document.getElementById('disabledImageZone').style.display = 'block';
//	document.getElementById('loaderContainer').style.display = 'block';
document.getElementById('loaderContainer').innerHTML="<img src='./img/loading.gif' align='absmiddle'>";// by syu
setTimeout("load_catlist_content_aj('"+nt+"', '"+pp+"', '"+st+"', '"+ci+"');",30);}function startAjaxIndicatorAlphabet(category,firstname)// for searching by alphabet by syu 1/2008
{document.getElementById('loaderContainer').innerHTML="<img src='./img/loading.gif' align='absmiddle'>";// by syu
setTimeout("load_catlist_content_cattype_aj_alphabet('"+category+"', '"+firstname+"');",30);}function startAjaxPhotoCloud(nt,pp,st)// for searching by alphabet by syu 1/2008
{document.getElementById('loaderContainer').innerHTML="<img src='./img/loading.gif' align='absmiddle'>";// by syu
setTimeout("load_photocloud_aj('"+nt+"', '"+pp+"', '"+st+"');",2);}function ingredient_search(num_items,per_page,start_item)// by syu 2/2008
{if(start_item==''||start_item==undefined){start_item=0;}goAnim();search_item=document.getElementById('searchKeyWord').value;document.getElementById("search-box-div").style.visibility="visible";document.getElementById("search-box-div").style.display="block";document.getElementById("bodyDiv").style.display="none";xmlhttp=(window.XMLHttpRequest?new XMLHttpRequest():((window.ActiveXObject)?new ActiveXObject("Microsoft.XMLHTTP"):null));if(xmlhttp){xmlhttp.open("POST",'instant-ingredientgenius.php?',false)// added 12/2007 by syu to make url unique for ajax smarty
;xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded');xmlhttp.send('&search_item='+search_item+'&num_items='+num_items+'&per_page='+per_page+'&start_item='+start_item);}document.getElementById("search-box-div").innerHTML=xmlhttp.responseText;setTimeout(stopAnim,100);}


var animcounter=0;var animInterval=null;function goAnim(){document.getElementById('instantIndicator').style.display='';// hide search animation
animInterval=setInterval('startAnim()',50);}function startAnim(){//document.images[animcounter].style.display = 'none';
document.getElementById('anim_'+animcounter).style.visibility='hidden';animcounter=(animcounter+1)%7;//document.images[animcounter].style.display = '';
document.getElementById('anim_'+animcounter).style.visibility='visible';}function stopAnim(){document.getElementById('instantIndicator').style.display='none';// hide search animation
clearInterval(animInterval);// document.getElementById('instantIndicator').style.visibility = 'hidden'; // hide search animation
}function search_result(base_url,num_items,per_page,start_item){if(start_item==''||start_item==undefined){start_item=0;}base_url=document.getElementById('base_url').value;if(base_url==1){url='instant-ingredientgenius.php?base_url=1';}else{url='instant-ajax-search.php?base_url=0';};goAnim();search_item=document.getElementById('searchKeyWord').value;document.getElementById("search-box-div").style.visibility="visible";document.getElementById("search-box-div").style.display="block";document.getElementById("bodyDiv").style.display="none";xmlhttp=(window.XMLHttpRequest?new XMLHttpRequest():((window.ActiveXObject)?new ActiveXObject("Microsoft.XMLHTTP"):null));if(xmlhttp){xmlhttp.open("POST",url,false)// added 12/2007 by syu to make url unique for ajax smarty
;xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded');xmlhttp.send('&search_item='+search_item+'&num_items='+num_items+'&per_page='+per_page+'&start_item='+start_item);}document.getElementById("search-box-div").innerHTML=xmlhttp.responseText;setTimeout(stopAnim,100);}function close_result(){document.getElementById("search-box-div").style.display="none";document.getElementById("search-box-div").style.display="none";document.getElementById("bodyDiv").style.display="block";document.getElementById("bodyDiv").style.visibility="visible";}function ingredient_search(num_items,per_page,start_item)// by syu 2/2008
{if(start_item==''||start_item==undefined){start_item=0;}goAnim();search_item=document.getElementById('searchKeyWord').value;document.getElementById("search-box-div").style.visibility="visible";document.getElementById("search-box-div").style.display="block";document.getElementById("bodyDiv").style.display="none";xmlhttp=(window.XMLHttpRequest?new XMLHttpRequest():((window.ActiveXObject)?new ActiveXObject("Microsoft.XMLHTTP"):null));if(xmlhttp){xmlhttp.open("POST",'instant-ingredientgenius.php?',false)// added 12/2007 by syu to make url unique for ajax smarty
;xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded');xmlhttp.send('&search_item='+search_item+'&num_items='+num_items+'&per_page='+per_page+'&start_item='+start_item);}document.getElementById("search-box-div").innerHTML=xmlhttp.responseText;setTimeout(stopAnim,100);}



function show_hide_frame()
{
		document.getElementById("div_frame").style.visibility = "visible";
		document.getElementById("div_frame").style.display = "block";
}
function set_value(rated)
{
	$('rating').value = rated;
	document.getElementById('ratingStar').innerHTML = "Currently "+rated+"/5 Stars.";
	rated = rated * 20;
	document.getElementById('ratingStar').style.width = rated+"%";
}

function send_to_login()
{
	window.location.href = './login.php';
}


function add_to_favourite(item_id)
{
	window.location.href = './item-details.php?add_to_item='+item_id;
}

function remove_from_favourite(item_id)
{
	window.location.href = './item-details.php?remove_from_item='+item_id;
}

var show = 0;
function rating_popup_show()
{
	if (show) {
		$('commentContainer').hide();
		show = 0;
	} else {
		$('commentContainer').show();
		show = 1;
	}
}