function createCookie(name,value,days) {
	if (days) {
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
	}
	else var expires = "";
	document.cookie = name+"="+value+expires+"; path=/";
}

function readCookie(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 haveCookie() {
  if (document.cookie) {
    return true; 
  } else {
    createCookie('test',1,false);
    if(!document.cookie) {
      return false; 
    } 
    return true;
  }
}
function eraseCookie(name) {
	createCookie(name,"",-1);
}

function checkIsMobile() {

	if (navigator.userAgent.match(/(up.browser|up.link|mmp|symbian|iphone|ipod|android|smartphone|midp|wap|vodafone|windows ce|pocket|kindle|mobile|treo|ipaq|palm|nokia|blackberry|opera mini|lg\-|lge\-|htc|mot\-|mot |psp|sonyericsson|sgh|iemobile|bada|rx\-51 n900)/i)) {
		return true;
	}
	
	return false;
}




this.screenshotPreview = function(){	
	/* CONFIG */

		
		// these 2 variable determine popup's distance from the cursor
		// you might want to adjust to get the right result
		
	/* END CONFIG */
	$("a.screenshot").hover(function(e){
		this.t = this.title;
		this.title = "";	
		var c = (this.t != "") ? "<br/>" + this.t : "";
		$("body").append("<p id='screenshot'><img src='"+ this.rel +"' alt='url preview' />"+ c +"</p>");								 
		$("#screenshot")
			.fadeIn("fast");						
						

    },
	function(){
		this.title = this.t;	
		$("#screenshot").remove();
    });	
		
};


function favoris() {
 window.sidebar.addPanel("woodmancastingx","http://www.woodmancastingx.com",""); 
 window.external.AddFavorite("http://www.woodmancastingx.com","woodmancastingx"); 
}


