function deleteCookie()
{
	var emailEncryptedName=new String("dwbeabc101"); 
	var passwordEncryptedName=new String("dwbeabc11"); 
	var remembermeEncryptedName=new String("dwbeabccf"); 
	var exdate=new Date();
	var expiredays=new String("sds");
	exdate.setDate(exdate.getDate());
	
    document.cookie = emailEncryptedName + "=; expires=Fri, 31 Dec 1999 23:59:59 GMT;path=/";
	document.cookie = passwordEncryptedName + "=; expires=Fri, 31 Dec 1999 23:59:59 GMT;path=/";	
	document.cookie = remembermeEncryptedName + "=; expires=Fri, 31 Dec 1999 23:59:59 GMT;path=/";
    
	
}

function logout(PAGE_TYPE){
	if(parent.document.getElementById('valueChanged') != null && parent.document.getElementById('valueChanged').value =='true'){
		document.getElementById("logoutCheck").value ="logout";
		return false;
	}else{
	deleteCookie(); // deleting cookies 
	var url = app.URLs.logout;
	var HOME_PAGE= app.URLs.HOME_PAGE;
	var CART_PAGE= app.URLs.CART_PAGE;
    
    	
	$.get(url ,function(transport) {						
		var returnValue = transport;
		try{
			 
			  if(PAGE_TYPE=='MYACCOUNT_PAGE'){
				  document.location.href = HOME_PAGE;				  			   
			  }else if(PAGE_TYPE=='WRITE_REVIEW_PAGE'){        
				  document.location.href = HOME_PAGE;			 	  
			  }else if(PAGE_TYPE=='ASK_QUESTION_PAGE'){ 
				  document.location.href = HOME_PAGE; 
			  }else if(PAGE_TYPE=='ABOUT_YOU_PAGE'){
				  document.location.href = HOME_PAGE;			  			  
			  }else if(PAGE_TYPE=='SHIPPING_PAGE' || PAGE_TYPE=='BILLING_PAGE' || PAGE_TYPE=='SUMMARY_PAGE'){					
					document.location.href=CART_PAGE;					 
			  }else{
				var loc_href = location.href;
				if(loc_href.substring(loc_href.length-1) == "#"){
					loc_href = loc_href.substring(0, loc_href.length-1);
				}
				if (browserType == "Safari" && browserOs == "Mac"){
					loc_href = encodeURI(loc_href);
				}
		   		//location.reload();
				if(document.location.hash!="")
					document.location.reload();
				
		   		document.location.href=loc_href;		   		
			  }
			}
		catch(e){
				alert(e);
		}
	},"text");
	}
}

function setCookie(c_name,value,expiredays)
{
	var exdate=new Date();
	exdate.setDate(exdate.getDate()+expiredays);
	document.cookie=c_name+ "=" +escape(value)+
	((expiredays==null) ? "" : ";expires="+exdate.toGMTString())+"; path=/";
}

function roll_over(img_name,img_src) {
	document[img_name].src=img_src;
	}

$(document).ready(function(){	
	if(!app.util.cookiesEnabled()) {
		jQuery("#cookiesdisabled").show();
	}
});

