
function hidegid(){
	var gidcont = jQuery("#venera_holder");
	var gid = jQuery("#venera");
	var geturl = location.href;
	gidcont.slideUp('slow', function() {
			gid.empty();
		});
		
}

function showgid(){
	var pagesarr = ["countryinfo","tours", "tourdates", "tourprices"];	
	var gidcont = jQuery("#venera_holder");
	var gid = jQuery("#venera");
	var geturl = location.href;
		for(var i=0; i<pagesarr.length; i++){
			var page = pagesarr[i];
			if(geturl.indexOf(page)!=-1){
				var gidpath = "/venera/"+page+".htm";
				break;
			} 		
		}
	
	var fsrc = gidpath? gidpath : "/import/venera/index.htm";

	
	
	var curframe = "<iframe  src='"+fsrc+"' width='270' height='340' frameborder='0' scrolling='no'></iframe>";
		gid.html(curframe);
		gidcont.slideDown(1);
		
				
		//count
		
		
		
		
}


jQuery(document).ready(function() {
		
	//кук чек
	var check = jQuery.cookie("venera");
	var gidcaller = jQuery("#gid_call");
	
	
	//if(!check){ //нет куки - ставим
		
		jQuery.cookie("venera", "off");		
		gidcaller.addClass("off");
		
	/*} else { // кука есть
		
		var gidstate = jQuery.cookie("venera");
		if(gidstate=="on"){
			gidcaller.addClass("on").text("СКРЫТЬ ГИДА");
			showgid();		
		} else {
			gidcaller.addClass("off");
		}
	} */
	
	gidcaller.click(function(){
		var button = jQuery(this);
		
		if(!button.hasClass("off")){
		
			hidegid();
			button.attr("className", "off");
			button.text("");
			jQuery.cookie("venera", "off");
			
			
		} else {
		
			showgid();
			button.attr("className", "on");
			button.text("СКРЫТЬ ГИДА");
			jQuery.cookie("venera", "on");
			
		}
		
		
	});
	
	
	
	
}); //dom ready
