if (typeof document.attachEvent!='undefined') {   window.attachEvent('onload',init);   document.attachEvent('onmousemove',moveMouse);   document.attachEvent('onclick',checkMove); }else {   window.addEventListener('load',init,false);   document.addEventListener('mousemove',moveMouse,false);   document.addEventListener('click',checkMove,false);}var oDv=document.createElement("div");var dvHdr=document.createElement("div");var dvBdy=document.createElement("div");var windowlock,boxMove,fixposx,fixposy,lockX,lockY,fixx,fixy,ox,oy,boxLeft,boxRight,boxTop,boxBottom,evt,mouseX,mouseY,boxOpen,totalScrollTop,totalScrollLeft;boxOpen=false;ox=10;oy=10;lockX=0;lockY=0;function init() {	oDv.appendChild(dvHdr);	oDv.appendChild(dvBdy);	oDv.style.position="absolute";	oDv.style.visibility='hidden';	document.body.appendChild(oDv);	}function defHdrStyle() {	//dvHdr.innerHTML='<img  style="vertical-align:middle"  src="info.gif">&nbsp;&nbsp;'+dvHdr.innerHTML;	dvHdr.style.display='none';	dvHdr.style.fontWeight='bold';	dvHdr.style.width='240px';	dvHdr.style.fontFamily='arial';	dvHdr.style.border='1px solid #A5CFE9';	dvHdr.style.padding='3';	dvHdr.style.fontSize='11';	dvHdr.style.color='#4B7A98';	dvHdr.style.background='#D5EBF9';	dvHdr.style.filter='alpha(opacity=85)'; // IE	dvHdr.style.opacity='0.85'; // FF}	//dvBdy.style.border='2px solid #ddd';	//dvBdy.style.width='240px';	//dvBdy.style.fontFamily='arial';	//dvBdy.style.fontSize='11px';	//dvBdy.style.padding='5px 10px';	//dvBdy.style.color='#333333';	//dvBdy.style.background='#ececec url('+location.pathname+'wp-content/themes/onenewspremium/images/bg_newsblock.gif) repeat-x left top';	//dvBdy.style.filter='alpha(opacity=85)'; // IE	//dvBdy.style.opacity='0.85'; // FFfunction checkElemBO(txt) {if (!txt || typeof(txt) != 'string') return false;if ((txt.indexOf('header')>-1)&&(txt.indexOf('body')>-1)&&(txt.indexOf('[')>-1)&&(txt.indexOf('[')>-1))    return true;else   return false;}function scanBO(curNode) {	  if (checkElemBO(curNode.title)) {         curNode.boHDR=getParam('header',curNode.title);         curNode.boBDY=getParam('body',curNode.title);			curNode.boCSSBDY=getParam('cssbody',curNode.title);						curNode.boCSSHDR=getParam('cssheader',curNode.title);			curNode.IEbugfix=(getParam('hideselects',curNode.title)=='on')?true:false;			curNode.fixX=parseInt(getParam('fixedrelx',curNode.title));			curNode.fixY=parseInt(getParam('fixedrely',curNode.title));			curNode.absX=parseInt(getParam('fixedabsx',curNode.title));			curNode.absY=parseInt(getParam('fixedabsy',curNode.title));			curNode.offY=(getParam('offsety',curNode.title)!='')?parseInt(getParam('offsety',curNode.title)):25;			curNode.offX=(getParam('offsetx',curNode.title)!='')?parseInt(getParam('offsetx',curNode.title)):-100;			curNode.fade=(getParam('fade',curNode.title)=='on')?true:false;			curNode.fadespeed=(getParam('fadespeed',curNode.title)!='')?getParam('fadespeed',curNode.title):0.04;			curNode.delay=(getParam('delay',curNode.title)!='')?parseInt(getParam('delay',curNode.title)):0;			if (getParam('requireclick',curNode.title)=='on') {				curNode.requireclick=true;				document.all?curNode.attachEvent('onclick',showHideBox):curNode.addEventListener('click',showHideBox,false);				document.all?curNode.attachEvent('onmouseover',hideBox):curNode.addEventListener('mouseover',hideBox,false);			}			else {// Note : if requireclick is on the stop clicks are ignored   			   			if (getParam('doubleclickstop',curNode.title)!='off') {   				document.all?curNode.attachEvent('ondblclick',pauseBox):curNode.addEventListener('dblclick',pauseBox,false);   			}	   			if (getParam('singleclickstop',curNode.title)=='on') {   				document.all?curNode.attachEvent('onclick',pauseBox):curNode.addEventListener('click',pauseBox,false);   			}   		}			curNode.windowLock=getParam('windowlock',curNode.title).toLowerCase()=='off'?false:true;			curNode.title='';			curNode.hasbox=1;	   }	   else	      curNode.hasbox=2;   }function getParam(param,list) {	var reg = new RegExp('([^a-zA-Z]' + param + '|^' + param + ')\\s*=\\s*\\[\\s*(((\\[\\[)|(\\]\\])|([^\\]\\[]))*)\\s*\\]');	var res = reg.exec(list);	var returnvar;	if(res)		return res[2].replace('[[','[').replace(']]',']');	else		return '';}function Left(elem){		var x=0;	if (elem.calcLeft)		return elem.calcLeft;	var oElem=elem;	while(elem){		 if ((elem.currentStyle)&& (!isNaN(parseInt(elem.currentStyle.borderLeftWidth)))&&(x!=0))		 	x+=parseInt(elem.currentStyle.borderLeftWidth);		 x+=elem.offsetLeft;		 elem=elem.offsetParent;	  } 	oElem.calcLeft=x;	return x;	}function Top(elem){	 var x=0;	 if (elem.calcTop)	 	return elem.calcTop;	 var oElem=elem;	 while(elem){			 	 if ((elem.currentStyle)&& (!isNaN(parseInt(elem.currentStyle.borderTopWidth)))&&(x!=0))		 	x+=parseInt(elem.currentStyle.borderTopWidth); 		 x+=elem.offsetTop;	         elem=elem.offsetParent; 	 }  	 oElem.calcTop=x; 	 return x; 	 }var ah,ab;function applyStyles() {	if(ab)		oDv.removeChild(dvBdy);	if (ah)		oDv.removeChild(dvHdr);	dvHdr=document.createElement("div");	dvBdy=document.createElement("div");	CBE.boCSSBDY?dvBdy.className=CBE.boCSSBDY:defBdyStyle();	CBE.boCSSHDR?dvHdr.className=CBE.boCSSHDR:defHdrStyle();	dvHdr.innerHTML=CBE.boHDR;	dvBdy.innerHTML=CBE.boBDY;	ah=false;	ab=false;	if (CBE.boHDR!='') {				oDv.appendChild(dvHdr);		ah=true;	}		if (CBE.boBDY!=''){		oDv.appendChild(dvBdy);		ab=true;	}	}var CSE,iterElem,LSE,CBE,LBE, totalScrollLeft, totalScrollTop, width, height ;var ini=false;function SHW() {   if (document.body && (document.body.clientWidth !=0)) {      width=document.body.clientWidth;      height=document.body.clientHeight;   }   if (document.documentElement && (document.documentElement.clientWidth!=0) && (document.body.clientWidth + 20 >= document.documentElement.clientWidth)) {      width=document.documentElement.clientWidth;         height=document.documentElement.clientHeight;      }      return [width,height];}var ID=null;function moveMouse(e) {   //boxMove=true;	e?evt=e:evt=event;		CSE=evt.target?evt.target:evt.srcElement;		if (!CSE.hasbox) {	   // Note we need to scan up DOM here, some elements like TR don't get triggered as srcElement	   iElem=CSE;	   while ((iElem.parentNode) && (!iElem.hasbox)) {	      scanBO(iElem);	      iElem=iElem.parentNode;	   }	   	}		if ((CSE!=LSE)&&(!isChild(CSE,dvHdr))&&(!isChild(CSE,dvBdy))){			   if (!CSE.boxItem) {			iterElem=CSE;			while ((iterElem.hasbox==2)&&(iterElem.parentNode))					iterElem=iterElem.parentNode; 			CSE.boxItem=iterElem;			}		iterElem=CSE.boxItem;		if (CSE.boxItem&&(CSE.boxItem.hasbox==1))  {			LBE=CBE;			CBE=iterElem;			if (CBE!=LBE) {				applyStyles();				if (!CBE.requireclick)					if (CBE.fade) {						if (ID!=null)							clearTimeout(ID);						ID=setTimeout("fadeIn("+CBE.fadespeed+")",CBE.delay);					}					else {						if (ID!=null)							clearTimeout(ID);						COL=1;						ID=setTimeout("oDv.style.visibility='visible';ID=null;",CBE.delay);											}				if (CBE.IEbugfix) {hideSelects();} 				fixposx=!isNaN(CBE.fixX)?Left(CBE)+CBE.fixX:CBE.absX;				fixposy=!isNaN(CBE.fixY)?Top(CBE)+CBE.fixY:CBE.absY;							lockX=0;				lockY=0;				boxMove=true;				ox=CBE.offX?CBE.offX:10;				oy=CBE.offY?CBE.offY:10;			}		}		else if (!isChild(CSE,dvHdr) && !isChild(CSE,dvBdy) && (boxMove))	{			// The conditional here fixes flickering between tables cells.			if ((!isChild(CBE,CSE)) || (CSE.tagName!='TABLE')) {   			   			CBE=null;   			if (ID!=null)  					clearTimeout(ID);   			fadeOut();   			showSelects();			}		}		LSE=CSE;	}	else if (((isChild(CSE,dvHdr) || isChild(CSE,dvBdy))&&(boxMove))) {		totalScrollLeft=0;		totalScrollTop=0;				iterElem=CSE;		while(iterElem) {			if(!isNaN(parseInt(iterElem.scrollTop)))				totalScrollTop+=parseInt(iterElem.scrollTop);			if(!isNaN(parseInt(iterElem.scrollLeft)))				totalScrollLeft+=parseInt(iterElem.scrollLeft);			iterElem=iterElem.parentNode;					}		if (CBE!=null) {			boxLeft=Left(CBE)-totalScrollLeft;			boxRight=parseInt(Left(CBE)+CBE.offsetWidth)-totalScrollLeft;			boxTop=Top(CBE)-totalScrollTop;			boxBottom=parseInt(Top(CBE)+CBE.offsetHeight)-totalScrollTop;			doCheck();		}	}		if (boxMove&&CBE) {		// This added to alleviate bug in IE6 w.r.t DOCTYPE		bodyScrollTop=document.documentElement&&document.documentElement.scrollTop?document.documentElement.scrollTop:document.body.scrollTop;		bodyScrollLet=document.documentElement&&document.documentElement.scrollLeft?document.documentElement.scrollLeft:document.body.scrollLeft;		mouseX=evt.pageX?evt.pageX-bodyScrollLet:evt.clientX-document.body.clientLeft;		mouseY=evt.pageY?evt.pageY-bodyScrollTop:evt.clientY-document.body.clientTop;		if ((CBE)&&(CBE.windowLock)) {			mouseY < -oy?lockY=-mouseY-oy:lockY=0;			mouseX < -ox?lockX=-mouseX-ox:lockX=0;			mouseY > (SHW()[1]-oDv.offsetHeight-oy)?lockY=-mouseY+SHW()[1]-oDv.offsetHeight-oy:lockY=lockY;			mouseX > (SHW()[0]-dvBdy.offsetWidth-ox)?lockX=-mouseX-ox+SHW()[0]-dvBdy.offsetWidth:lockX=lockX;					}		oDv.style.left=((fixposx)||(fixposx==0))?fixposx:bodyScrollLet+mouseX+ox+lockX+"px";		oDv.style.top=((fixposy)||(fixposy==0))?fixposy:bodyScrollTop+mouseY+oy+lockY+"px";					}}function doCheck() {		if (   (mouseX < boxLeft)    ||     (mouseX >boxRight)     || (mouseY < boxTop) || (mouseY > boxBottom)) {		if (!CBE.requireclick)			fadeOut();		if (CBE.IEbugfix) {showSelects();}		CBE=null;	}}function pauseBox(e) {   e?evt=e:evt=event;	boxMove=false;	evt.cancelBubble=true;}function showHideBox(e) {	oDv.style.visibility=(oDv.style.visibility!='visible')?'visible':'hidden';}function hideBox(e) {	oDv.style.visibility='hidden';}var COL=0;var stopfade=false;function fadeIn(fs) {		ID=null;		COL=0;		oDv.style.visibility='visible';		fadeIn2(fs);}function fadeIn2(fs) {		COL=COL+fs;		COL=(COL>1)?1:COL;		oDv.style.filter='alpha(opacity='+parseInt(100*COL)+')';		oDv.style.opacity=COL;		if (COL<1)		 setTimeout("fadeIn2("+fs+")",20);		}function fadeOut() {	oDv.style.visibility='hidden';	}function isChild(s,d) {	while(s) {		if (s==d) 			return true;		s=s.parentNode;	}	return false;}var cSrc;function checkMove(e) {	e?evt=e:evt=event;	cSrc=evt.target?evt.target:evt.srcElement;	if ((!boxMove)&&(!isChild(cSrc,oDv))) {		fadeOut();		if (CBE&&CBE.IEbugfix) {showSelects();}		boxMove=true;		CBE=null;	}}function showSelects(){   var elements = document.getElementsByTagName("select");   for (i=0;i< elements.length;i++){      elements[i].style.visibility='visible';   }}function hideSelects(){   var elements = document.getElementsByTagName("select");   for (i=0;i< elements.length;i++){   elements[i].style.visibility='hidden';   }};// This code has been placed in the public domain and may be used without         ////////////////////////////////////////////////////////////////////////////////         // Video window function, handles urls, sets up embeds, makes window visible/invisible         ////////////////////////////////////////////////////////////////////////////////         function playVid(vidId, noBlackout) {            ////////////////////////////////////////////////////////////////////////////////            // Test to see if our video and blackout divisions have been set up.            // If no division was declared in the HTML then we'll go ahead and automatically            // create and style the necessary division.            ////////////////////////////////////////////////////////////////////////////////            if (_vidPane==null) {               ////////////////////////////////////////////////////////////////////////////////               /// Video Pane wasn't set up so see if it's declared in the HTML               ////////////////////////////////////////////////////////////////////////////////               _vidPane=document.getElementById('vidPane');               if (!_vidPane) {                  // user didn't create the division so create it for him.                  // also asume no styleSheet and set basic styles.                  var tbody = document.getElementsByTagName("body")[0];                  tnode = document.createElement('div');                  tnode.id='vidPane';                  tnode.className='vidFrame';                  tbody.appendChild(tnode);                  _vidPane=document.getElementById('vidPane');                  _vidPane.style.position='absolute';                  _vidPane.style.display='none';                  _vidPane.style.backgroundColor='#fff';                  _vidPane.style.width='435px';                  _vidPane.style.height='372px';                  _vidPane.style.fontFamily='verdana';                  _vidPane.style.fontSize='9pt';                  _vidPane.style.zIndex='100';                  _vidPane.style.MozBorderRadius='10';               }               // If _vidPane wasn't defined then for sure _blackout wasn't               // so see if it was defined in the HTML               _blackout=document.getElementById('blackout');               if (!_blackout) {                  // user didn't create the division so create it for him.                  // also asume no styleSheet and set basic styles.                  tnode = document.createElement('div');                  tnode.id='blackout';                  tbody.appendChild(tnode);                  _blackout=document.getElementById('blackout');                  _blackout.style.position='absolute';                  _blackout.style.display='none';                  _blackout.style.left='0px';                  _blackout.style.top='0px';                  _blackout.style.backgroundColor='#000';                  _blackout.style.opacity='.9';                  _blackout.style.filter='alpha(opacity=90)';                  _blackout.style.zIndex='50';               }               // Initialize the starting location of the video.               _vidPane.style.top='75px';    // Starting location horozontal               _vidPane.style.left='75px';   // Starting location verticle            }            // Shows (or hides) the vidPane layer.   Accepts 2 parameteres.            // vidId is null (close window) or an anchor object (contains HREF value)            // vidId is mandatory example: <a href="someservice.com/somevideo.swf" onClick='return playVid(this);'></a>            // noBlackout is optional. If you pass true, the background will not be "greyed out".            if (vidId==null) {                // Null is passed by the "close" link, so we'll hide the layer.               _vidPane.style.display='none';         // Hide the division.               _vidPane.innerHTML='';                 // purge it's html (kill video)               _blackout.style.display='none';        // Hide the blackout layer.            } else {               // Snag the url from the passed object               vidId=vidId.href;               // Next three lines make the blackout layer visible               // and makes sure it covers the entire page.               if (!noBlackout) {                  _blackout.style.width='100%';                  _blackout.style.height=(document.body.offsetHeight<screen.height) ? screen.height+'px' : document.body.offsetHeight+20+'px';                   _blackout.style.display='block';               } else {                  _blackout.style.display='none';        // Hide the blackout layer.               }               // Break out the URL passed to this function (so vidInfo[0]=http, [1]=domain, etc               var vidInfo = vidId.split('/');               // We're building a temporary string called vidstring.                // vidstring will hold the HTML as we build it based on the service               // being used.  The next few lines contains items which are common               // to all the services, or at least ignored if not directly used.                              var vidstring ='<center><embed style="margin-top: 5px;"';                 vidstring+=' enableJavascript="false" allowScriptAccess="never"';               vidstring+=' allownetworking="internal" type="application/x-shockwave-flash"';               vidstring+=' wmode="transparent" pluginspage="http://www.macromedia.com/go/getflashplayer" ';               if (vidInfo[2].indexOf('youtube.com')>=0) {                  ////////////////////////////////////////////////////////////////////////////////                  // YouTube (Use browser URL, autoplays)                  ////////////////////////////////////////////////////////////////////////////////                  vidInfo=vidId.match(/v=.+$/);                  vidInfo=String(vidInfo).replace(/v=/g,'');                  vidstring+=' src="http://www.youtube.com/v/'+vidInfo+'&autoplay=1" ';                  vidstring+=' height="350" width="425"></embed></center>';               } else if (vidInfo[2].indexOf('video.google.com')>=0) {                  ////////////////////////////////////////////////////////////////////////////////                  // Google (Use browser URL, autoplays)                  ////////////////////////////////////////////////////////////////////////////////                  vidInfo=vidId.match(/docid=.+$/);                  vidInfo=String(vidInfo).replace(/docid=/g,'');                  vidstring+='  src="http://video.google.com/googleplayer.swf?docId='+vidInfo+'&autoplay=1" ';                  vidstring+=' height="350" width=425"></embed></center>';               } else if (vidInfo[2].indexOf('metacafe.com')>0) {                  ////////////////////////////////////////////////////////////////////////////////                  // MetaCafe (Use browser URL, autoplays)                  ////////////////////////////////////////////////////////////////////////////////                  vidInfo=vidId.match(/watch.+$/);                  vidInfo=String(vidInfo).replace(/watch./,'');                  vidInfo=String(vidInfo).replace(/.$/,'');                  vidstring+=' flashVars="playerVars=autoPlay=yes" ';                  vidstring+=' src="http://www.metacafe.com/fplayer/'+vidInfo+'.swf" ';                  vidstring+=' width="400" height="345">';                    vidstring+='</embed></center>';               } else if (vidInfo[2].indexOf('ifilm.com')>=0) {                  ////////////////////////////////////////////////////////////////////////////////                  // iFilm (Use browser URL, autoplays)                  ////////////////////////////////////////////////////////////////////////////////                  vidInfo=vidId.match(/video.+$/);                  vidInfo=String(vidInfo).replace(/video./,'');                  vidstring+=' flashVars="flvbaseclip='+vidInfo+'&ip=true" ';                  vidstring+=' src="http://ifilm.com/efp" quality="high" name="efp" align="middle" ';                  vidstring+=' width="425" height="350">';                    vidstring+='</embed></center>';               } else if (vidInfo[2].indexOf('dailymotion.com')>=0) {                  ////////////////////////////////////////////////////////////////////////////////                  // Daily Motion (Use EMBED URL, autoplays)                  ////////////////////////////////////////////////////////////////////////////////                  vidInfo=vidId.match(/video.+$/);				  vidInfo2=vidId.match(/_.+$/);                  vidInfo=String(vidInfo).replace(/video./,'');                  vidInfo=String(vidInfo).replace(vidInfo2,'');				  vidstring+=' src="http://www.dailymotion.com/swf/'+vidInfo+'&related=1" flashVars="autoStart=1" ';                  vidstring+=' allowFullScreen="true" height="350" width="425">';                  vidstring+='</embed></center>';               } else if (vidInfo[2].indexOf('video.yahoo.com')>=0) {                  ////////////////////////////////////////////////////////////////////////////////                  // Yahoo Videos (Use EMBED URL, autoplays)                  ////////////////////////////////////////////////////////////////////////////////                  vidInfo=vidId.match(/watch.+$/);                  vidInfo=String(vidInfo).replace(/watch./,'');				  var vidtemp = new Array();				  vidtemp = vidInfo.split('/');				  vidstring+=' src="http://d.yimg.com/static.video.yahoo.com/yep/YV_YEP.swf" ';                  vidstring+=' allowFullScreen="true" height="350" width="425" flashVars="id='+vidtemp[1]+'&vid='+vidtemp[0]+'&lang=en-us&intl=us">';                  vidstring+='</embed></center>';               } else if (vidInfo[2].indexOf('break.com')>=0) {                  ////////////////////////////////////////////////////////////////////////////////                  // Break (use EMBED URL, autostarts)                  ////////////////////////////////////////////////////////////////////////////////                  vidstring+=' src="'+vidId+'&autoplay=1" ';                  vidstring+=' width="425" height="350">';                  vidstring+='</embed></center>';               } else if (vidInfo[2].indexOf('shoutfile.com')>=0) {                  ////////////////////////////////////////////////////////////////////////////////                  // Shoutfile (use EMBED URL, does not autostart)                  ////////////////////////////////////////////////////////////////////////////////                  vidstring+=' src="'+vidId+'"';                  vidstring+=' width="400" height="300">';                  vidstring+='</embed></center>';               } else if (vidInfo[2].indexOf('soapbox.msn.com')>=0) {                  ////////////////////////////////////////////////////////////////////////////////                  // MSN Soapbox (use the LINK, autostarts)                  ////////////////////////////////////////////////////////////////////////////////                  vidInfo=vidId.match(/vid=.+$/);                  vidInfo=String(vidInfo).replace(/vid=/g,'');                  vidstring+=' src="http://images.soapbox.msn.com/flash/soapbox1_1.swf" ';                  vidstring+=' flashvars="c=v&ap=true&v='+vidInfo+'" ';                  vidstring+=' height="360" width="412"></embed></center>';               } else if (vidInfo[2].indexOf('atomfilms.com')>=0) {                  ////////////////////////////////////////////////////////////////////////////////                  // AtomFilms (use URL, does not autostart), pretty lame embed service IMHO                  ////////////////////////////////////////////////////////////////////////////////                  vidInfo=vidId.match(/film\/.+(\.jsp)/);                  vidInfo=String(vidInfo[0]).replace(/film\//g,'');                  vidInfo=String(vidInfo).replace(/\.jsp/g,'');                  vidstring+=' src="http://www.atomfilms.com:80/a/autoplayer/shareEmbed.swf?keyword='+vidInfo+'" ';                  vidstring+=' height="350" width="425" autostart="true"></embed></center>';               } else {                  ////////////////////////////////////////////////////////////////////////////////                  // Failed.                  ////////////////////////////////////////////////////////////////////////////////                  vidstring += '></embed><BR><BR><BR>Unknown video service.</center>';               }                  vidstring+= '<div style="background:#fff;text-align:right;padding:10px 5px 10px 5px"><A HREF="'+vidId+'" target="_blank"><strong>VIDEO LINK</strong></A> &nbsp;|&nbsp; <A style="color=#555" HREF="#" onClick="return(playVid())"><strong>CLOSE X</strong></A><div>';			                  // Insert our HTML and display the video window.               _vidPane.innerHTML=vidstring;               // Set the Y position of the video window so it's in the visible clip               var scrollTop = 0;               if (document.documentElement && document.documentElement.scrollTop)	                scrollTop = document.documentElement.scrollTop;               else if (document.body)	                scrollTop = document.body.scrollTop               _vidPane.style.top=scrollTop+250+'px';			   _vidPane.style.left=((document.body.clientWidth/2)-200)+'px';               // Video window was hidden so we'll make it visible               _vidPane.style.display='block';             }            // return false so the browser won't follow through with A HREF clicks.            return(false);         }         ////////////////////////////////////////////////////////////////////////////////         // Drag and Grab handlers         ////////////////////////////////////////////////////////////////////////////////         function moveHandler(e){            // Called automatically whenever the mouse is moved after a drag event starts            if (e == null) { e = window.event }  // Get event data, if it wasn't passed, get it IE style.            if ( _dragOK ){                      // is our global var set to true? is it ok to move the object?               _savedTarget.style.left=e.clientX-_dragXoffset+'px';  //OK to move, calculate the offset and move it               _savedTarget.style.top=e.clientY-_dragYoffset+'px';   // calculate the y offset and move it.               return false;                                         // return false so browser doesn't try to do anything else.            }                                   // End _dragOK check         }                                      // End moveHandler               function cleanup(e) {            // Called whenever user lets up off a mouse button after a drag event starts            document.onmousemove=null;                     // Turn off the mousemove event (won't call moveHandler() now).            document.onmouseup=null;                       // Turn off the mouseup event (won't call cleanup() now).                                 _savedTarget.style.cursor=_orgCursor;          // Restore original mouse shape            _dragOK=false;                                 // Turn off the global constant we look for before moving stuff.         }               function dragHandler(e){            // Called automatically when user holds down the mouse button            var cursorType='-moz-grabbing';                               // Set mouse type to grabbing hand            if (e == null) { e = window.event; cursorType='move';}        // This is IE so get event info IE style            var target = e.target != null ? e.target : e.srcElement;      // Save object of the event            if (target.className=="vidFrame") {                           // Did mouse go down over our dragable object?               _orgCursor=target.style.cursor;                            // Remember the current mouse shape               _savedTarget=target;                                       // Remember the object we're working with               target.style.cursor=cursorType;                            // change mouse to "grab" icon                                            _dragOK=true;                                              // When true, movehandler will move the window               _dragXoffset=e.clientX-parseInt(_savedTarget.style.left);  // Remember current X offset               _dragYoffset=e.clientY-parseInt(_savedTarget.style.top);   // Remember current Y offset               document.onmousemove=moveHandler;                          // Call moveHandler() when mouse moves               document.onmouseup=cleanup;                                // Call cleanup() when user lets go of mouse btn               return false;                                              // IMPORTANT return false so browser doesn't do anything else.            }                                                             // End Click on classname = object check         }                                                                // End function dragHandler         // Start the event handler. When mouse is clicked, call dragHandler()	       	 document.onmousedown=dragHandler;         // Initialize global variables.         var _savedTarget=null;        // The target layer (effectively vidPane)         var _orgCursor=null;          // The original Cursor (mouse) Style so we can restore it         var _dragOK=false;            // True if we're allowed to move the element under mouse         var _dragXoffset=0;           // How much we've moved the element on the horozontal         var _dragYoffset=0;           // How much we've moved the element on the verticle         var _vidPane = null;          // Video Layer -- won't be defined until a video is called         var _blackout= null;          // blackout Layer. -- won't be defined until a video is called.;var textsize = 100;function changetextsize(up){	if(up){		textsize = parseFloat(textsize)+10;	}else{		textsize =parseFloat(textsize)-10;	}}function fsize(size,unit,id){	var vfontsize = document.getElementById(id);	if(vfontsize){		vfontsize.style.fontSize = size + unit;		createCookie("textsizestyle", textsize, 365);	}}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;};//Style Sheet Switcher version 1.1 Oct 10th, 2006var manual_or_random="manual" //"manual" or "random"var randomsetting="3 days" //"eachtime", "sessiononly", or "x days (replace x with desired integer)". Only applicable if mode is random.function getCookie(Name) { var re=new RegExp(Name+"=[^;]+", "i"); //construct RE to search for target name/value pairif (document.cookie.match(re)) //if cookie foundreturn document.cookie.match(re)[0].split("=")[1] //return its valuereturn null}function setCookie(name, value, days) {var expireDate = new Date()var expstring=(typeof days!="undefined")? expireDate.setDate(expireDate.getDate()+parseInt(days)) : expireDate.setDate(expireDate.getDate()-5)document.cookie = name+"="+value+"; expires="+expireDate.toGMTString()+"; path=/";}function deleteCookie(name){setCookie(name, "moot")}function setStylesheet(title, randomize){ //Main stylesheet switcher function. Second parameter if defined causes a random alternate stylesheet (including none) to be enabledvar i, cacheobj, altsheets=[""]for(i=0; (cacheobj=document.getElementsByTagName("link")[i]); i++) {if(cacheobj.getAttribute("rel").toLowerCase()=="alternate stylesheet" && cacheobj.getAttribute("title")) { //if this is an alternate stylesheet with titlecacheobj.disabled = truealtsheets.push(cacheobj) //store reference to alt stylesheets inside arrayif(cacheobj.getAttribute("title") == title) //enable alternate stylesheet with title that matches parametercacheobj.disabled = false //enable chosen style sheet}}if (typeof randomize!="undefined"){ //if second paramter is defined, randomly enable an alt style sheet (includes non)var randomnumber=Math.floor(Math.random()*altsheets.length)altsheets[randomnumber].disabled=false}return (typeof randomize!="undefined" && altsheets[randomnumber]!="")? altsheets[randomnumber].getAttribute("title") : "" //if in "random" mode, return "title" of randomly enabled alt stylesheet}function chooseStyle(styletitle, days){ //Interface function to switch style sheets plus save "title" attr of selected stylesheet to cookieif (document.getElementById){setStylesheet(styletitle)setCookie("mysheet", styletitle, days)}}function indicateSelected(element){ //Optional function that shows which style sheet is currently selected within group of radio buttons or select menuif (selectedtitle!=null && (element.type==undefined || element.type=="select-one")){ //if element is a radio button or select menuvar element=(element.type=="select-one") ? element.options : elementfor (var i=0; i<element.length; i++){if (element[i].value==selectedtitle){ //if match found between form element value and cookie valueif (element[i].tagName=="OPTION") //if this is a select menuelement[i].selected=trueelse //else if it's a radio buttonelement[i].checked=truebreak}}}}if (manual_or_random=="manual"){ //IF MANUAL MODEvar selectedtitle=getCookie("mysheet")if (document.getElementById && selectedtitle!=null) //load user chosen style sheet from cookie if there is one storedsetStylesheet(selectedtitle)}else if (manual_or_random=="random"){ //IF AUTO RANDOM MODEif (randomsetting=="eachtime")setStylesheet("", "random")else if (randomsetting=="sessiononly"){ //if "sessiononly" settingif (getCookie("mysheet_s")==null) //if "mysheet_s" session cookie is emptydocument.cookie="mysheet_s="+setStylesheet("", "random")+"; path=/" //activate random alt stylesheet while remembering its "title" valueelsesetStylesheet(getCookie("mysheet_s")) //just activate random alt stylesheet stored in cookie}else if (randomsetting.search(/^[1-9]+ days/i)!=-1){ //if "x days" settingif (getCookie("mysheet_r")==null || parseInt(getCookie("mysheet_r_days"))!=parseInt(randomsetting)){ //if "mysheet_r" cookie is empty or admin has changed number of days to persist in "x days" variablesetCookie("mysheet_r", setStylesheet("", "random"), parseInt(randomsetting)) //activate random alt stylesheet while remembering its "title" valuesetCookie("mysheet_r_days", randomsetting, parseInt(randomsetting)) //Also remember the number of days to persist per the "x days" variable}elsesetStylesheet(getCookie("mysheet_r")) //just activate random alt stylesheet stored in cookie} }
