/* --- BoxOver ---
/* --- v 2.1 17th June 2006
By Oliver Bryant with help of Matthew Tagg
http://boxover.swazz.org */

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
}

//function defBdyStyle() {
	//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'; // FF
//}

function 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;

// Customised function for inner window dimension
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';
   }
}

/* videopopup.js */

// This code has been placed in the public domain and may be used without
// compensation or attribution.

         ////////////////////////////////////////////////////////////////////////////////
         // 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)
                  ////////////////////////////////////////////////////////////////////////////////
                  vidstring+=' src="'+vidId+'" flashVars="autoStart=1" ';
                  vidstring+=' width="425" height="334">';
                  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.

/* custom.js */

function choose_search(searchthis){
  //alert(searchthis);
  if(document.getElementById('mysearchword').value == ''){
    alert('Please enter your search keyword!')
  } else if(searchthis == 'web'){
    //alert('web');
    document.forms["googlesearch"].searchword.value = document.getElementById('mysearchword').value;
    document.forms["googlesearch"].submit();
  } else {
    //alert('site');
    var str=document.getElementById('mysearchword').value;
    window.location = '/?s='+str.replace(' ','+');
  }
}

/*
*
*/
function site_or_web(site_web){
  var what_search = site_web;
  if(what_search == 'web'){
    document.getElementById('searchweb').setAttribute('class','hilite');
    document.getElementById('searchsite').setAttribute('class','');
    document.getElementById('goog-cust-search-logo').setAttribute('class','show');
  } else {
    document.getElementById('searchweb').setAttribute('class','');
    document.getElementById('searchsite').setAttribute('class','hilite');
    document.getElementById('goog-cust-search-logo').setAttribute('class','');
  }
}

function keyPressed(searchthis,e){
  var code=e.keyCode? e.keyCode : e.charCode
//check, for example, if the Enter key was pressed (code 13)
  if(code == 13){ //Enter key was pressed
    choose_search(searchthis);
  }
}

function defBdyStyle() {
	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';
}


/***********************************************
* Cross browser Marquee II- (c) Dynamic Drive (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit http://www.dynamicdrive.com/ for this script and 100s more.
***********************************************/

var delayb4scroll=2000 //Specify initial delay before marquee starts to scroll on page (2000=2 seconds)
var marqueespeed=2 //Specify marquee scroll speed (larger is faster 1-10)
var pauseit=1 //Pause marquee onMousever (0=no. 1=yes)?

////NO NEED TO EDIT BELOW THIS LINE////////////

var copyspeed=marqueespeed
var pausespeed=(pauseit==0)? copyspeed: 0
var actualheight=''

function scrollmarquee(){
  if (parseInt(cross_marquee.style.left)<(actualwidth*(-1)+4))
  cross_marquee.style.left=(parseInt(cross_marquee2.style.left)+actualwidth+4)+"px"
  if (parseInt(cross_marquee2.style.left)<(actualwidth*(-1)+4))
  cross_marquee2.style.left=(parseInt(cross_marquee.style.left)+actualwidth+4)+"px"
  cross_marquee2.style.left=parseInt(cross_marquee2.style.left)-copyspeed+"px"
  cross_marquee.style.left=parseInt(cross_marquee.style.left)-copyspeed+"px"
}

function initializemarquee(){
  cross_marquee=document.getElementById("vmarquee")
  cross_marquee2=document.getElementById("vmarquee2")
  cross_marquee.style.left=0
  marqueewidth=document.getElementById("marqueecontainer").offsetWidth
  actualwidth=cross_marquee.firstChild.offsetWidth
  cross_marquee2.style.left=actualwidth+4+'px'
  cross_marquee2.innerHTML=cross_marquee.innerHTML
  setTimeout('lefttime=setInterval("scrollmarquee()",30)', delayb4scroll)
}

/* To Disable the TOP MARQUEE */
/*
if (window.addEventListener)
  window.addEventListener("load", initializemarquee, false)
else if (window.attachEvent)
  window.attachEvent("onload", initializemarquee)
else if (document.getElementById)
  window.onload=initializemarquee
*/

function bookmarksite(title,url){
  if (window.sidebar) // firefox
    window.sidebar.addPanel(title, url, "");
  else if(window.opera && window.print){ // opera
    var elem = document.createElement('a');
    elem.setAttribute('href',url);
    elem.setAttribute('title',title);
    //elem.setAttribute('rel','sidebar');
    elem.click();
  }
  else if(document.all)// ie
    window.external.AddFavorite(url, title);
  else {
    rt("Sorry! Your browser doesn't support this function. Please bookmark this page manually.");
  }
}

