//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"));




//writing the tv object
 function writeobj(file,type,flashvars,tvor){
	 fileurl = '';
  	//width = (window.screen.width / 2) - 50;
	 for (i = 0; i <= file.length; i++) {
		fileurl = file.charAt (i) + fileurl
	  } 
	//Adding randon number
	//fileurl = fileurl + '?r=' + Math.random();
	if (parseInt(navigator.appVersion)>3) {
	 if (navigator.appName=="Netscape") {
	  //width = (window.innerWidth / 2) - 50;
	  width = 400;
	 }
	 else if (navigator.appName.indexOf("Microsoft")!=-1) {
	 	width  = (document.body.offsetWidth / 2) -50;
	 }
	 else {
	 	width = 400;
	 }
	}
	if (tvor == 0 || tvor == 2 || tvor == 3)
	height = width;
	else
	height = 40;
  	asx = '<object width="'+width+'" height="'+height+'" classid="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95" name="mediaplayer1"  id="mediaplayer1">';
	asx += ' <param name="Filename" value="'+fileurl+'">';
	asx += '<param name="EnableContextMenu" value="1">';
	asx += ' <param name="AutoStart" value="True">';
	asx += ' <param name="ShowControls" value="true">';
	asx += '<param name="ShowStatusBar" value="true">';
	asx += ' <param name="ShowDisplay" value="false">';
	asx += '<param name="volume" value="100">';
	asx += '<param name="uiMode" value="full">';
	asx += '<param name="windowlessVideo" value="0">';
	asx += '<param name="fullScreen" value="-1">';
	asx += '<PARAM NAME="EnableFullScreenControls" VALUE="true"> ';
	asx += '<param name="AutoRewind" value="True">';
	asx += '<param name="enableErrorDialogs" value="0">';
	asx += '<embed pluginspage="http://www.microsoft.com/isapi/redir.dll?prd=windows&sbp=mediaplayer&ar=Media&sba=Plugin&" src="'+fileurl+'" width='+width+'" height="'+height+'" autostart="True" showcontrols="True" showstatusbar="False"  showdisplay="true" autorewind="True" enableContextMenu=1 windowlessVideo=1 uiMode=full stretchToFit=1 fullscreen=0> </embed>';
	asx += '</object>';
	ram = '<EMBED src="'+fileurl+'" width="'+width+'" height="'+height+'" ';
	ram += ' type=audio/x-pn-realaudio-plugin AUTOSTART="TRUE" ';
	ram += ' CONTROLS="imagewindow" EnableFullScreenControls="true">';
	ram += '<EMBED SRC="'+fileurl+'" type=audio/x-pn-realaudio-plugin CONTROLS=ControlPanel WIDTH="'+width+'" HEIGHT="25" CONSOLE=1 NOJAVA=true >';
	
	swf = '<embed type="application/x-shockwave-flash" ';
	swf += 'src="' +fileurl+'" ';
	swf += 'bgcolor="#2b333c" quality="high" allowfullscreen="true" allowscriptaccess="always" ';
	swf += 'wmode="window" flashvars="'+flashvars+'" ';
	swf += 'height="'+height+'" width="'+width+'"></embed>';

	
	if (type == 'asx')
	writit(asx,'obj');
	else if (type == 'ram')
	writit(ram,'obj');
	else if (type == 'swf')
	writit(swf,'obj');
  }
  
 
  
  function writit(text,id)
	{
		if (document.getElementById)
		{
			x = document.getElementById(id);
			x.innerHTML = '';
			x.innerHTML = text;
		}
		else if (document.all)
		{
			x = document.all[id];
			x.innerHTML = text;
		}
		else if (document.layers)
		{
			x = document.layers[id];
			text2 = '<P CLASS="testclass">' + text + '</P>';
			x.document.open();
			x.document.write(text2);
			x.document.close();
		}
	}

 //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 **********************/