// JavaScript Document

$(document).ready(function() {	


 if (!$.cookie('the_width')) {
		$.cookie('the_width', 'val_c', { expires: 7, path: '/'});

	}
	else {		
		if ($.cookie('the_width') == 'val_a') {
	
			$("#lang li:first a:nth-child(1)").find("img")[0].setAttribute("src","http://www.shandong.gov.cn/sdgov/icon_widthsmall_on.gif");
		}
		else if ($.cookie('the_width') == 'val_b') {
		
			$("#lang li:first a:nth-child(2)").find("img")[0].setAttribute("src","http://www.shandong.gov.cn/sdgov/icon_widthmedium_on.gif");
		 }
	    else {
		
			$("#lang li:first a:nth-child(3)").find("img")[0].setAttribute("src","http://www.shandong.gov.cn/sdgov/icon_widthlarge_on.gif");
	    }
	}

 $("#lang li:first a:nth-child(1)").click(function(){  
    $.cookie('the_width', '', {expires: -1});  
    $("#full").width("90%"); 
    
    $(this).find("img")[0].setAttribute("src","http://www.shandong.gov.cn/sdgov/icon_widthsmall_on.gif");
  	$("#lang li:first a:nth-child(2)").find("img")[0].setAttribute("src","http://www.shandong.gov.cn/sdgov/icon_widthmedium.gif");
	  $("#lang li:first a:nth-child(3)").find("img")[0].setAttribute("src","http://www.shandong.gov.cn/sdgov/icon_widthlarge.gif");
	
	  $.cookie('the_width', 'val_a', { expires: 7, path: '/'}); 
	   
	});
  
  $("#lang li:first a:nth-child(2)").click(function(){ 
    $.cookie('the_width', '', {expires: -1});   
    $("#full").width("95%");	    
	   
	  $(this).find("img")[0].setAttribute("src","http://www.shandong.gov.cn/sdgov/icon_widthmedium_on.gif");
	  $("#lang li:first a:nth-child(1)").find("img")[0].setAttribute("src","http://www.shandong.gov.cn/sdgov/icon_widthsmall.gif");
	  $("#lang li:first a:nth-child(3)").find("img")[0].setAttribute("src","http://www.shandong.gov.cn/sdgov/icon_widthlarge.gif");
	  
	  $.cookie('the_width', 'val_b', { expires: 7, path: '/'});  
   
	});
	
  $("#lang li:first a:nth-child(3)").click(function(){  
    $.cookie('the_width', '', {expires: -1});  
    $("#full").width("100%");	
	
	  $(this).find("img")[0].setAttribute("src","http://www.shandong.gov.cn/sdgov/icon_widthlarge_on.gif");
	  $("#lang li:first a:nth-child(1)").find("img")[0].setAttribute("src","http://www.shandong.gov.cn/sdgov/icon_widthsmall.gif");
    $("#lang li:first a:nth-child(2)").find("img")[0].setAttribute("src","http://www.shandong.gov.cn/sdgov/icon_widthmedium.gif");
	
    $.cookie('the_width', 'val_c', { expires: 7, path: '/'});  	
	
	});
});