//<![CDATA[


	websticker = {
		legend : "tetris",
		pagename : "pgn=0;lev=0;pos=0;typ=0",
		url : "http://ad-apac.doubleclick.net/clk;222615425;46367683;l?http://nokia-X6play.minisite.agenda-asia.com/redirection/901",
		image_id : 93247,		
		pathImage : "http://ak.image1.netdrive.tv",
		pathRedirect : "http://hk.ndx.nextmedia.com/DFA/rdr.cfm",
		pathActivity : "http://hk.ndx.nextmedia.com/DFA/act.cfm",
		pathBait : "http://hk.ndx.nextmedia.com/DFA/bait.cfm",
		params : "8319DD6C3FAEF075818F8C5726067852E22A3E60ED8E8F5FD6EEF4D5F6DD39B0B60B651DBF18317B1DF20F5D2178022C6C386EA502434512" + "&ndxRef=" + encodeURIComponent(window.location.href),
		Ypos: 0,
		Xpos: 0
	};

	websticker.speed = 40;
	websticker.showhidemenu= false;	
	websticker.position= 'BottomRight';

	//websticker.coLayer = '25:250'; original
	websticker.coLayer = '25:250';
	websticker.coLayer = websticker.coLayer.split(':');	
	websticker.ll_layer = websticker.coLayer[0];	
	websticker.tt_layer = websticker.coLayer[1];	

	// FSCommand: Flash2Javascript
	function swfObj_DoFSCommand(command, args) { 
		if (command == "ndxActivity") { 
			//netDrive.Utils.logActivity(websticker.pathActivity, args, websticker.params);
		}
		if (command == "hidemenu") { 
			//netDrive.Utils.hidemenu();
		}
		if (command == "showmenu") { 
			//netDrive.Utils.showmenu();
		}
		if (command == "dismiss") { 
			websticker.dismiss();
		}
	};
	
	document.write("<SCRIPT LANGUAGE=\"VBScript\">");
	document.write("Sub swfObj_FSCommand(ByVal command, ByVal args)");
	document.write("    call swfObj_DoFSCommand(command, args)");
	document.write("end sub");
	document.write("<\/SCRIPT>");
	//*** Activity Logging [END]

	websticker.isIE = function(){
    return (document.compatMode && document.all)?true:false; // IE 6 or above
  };
  
  websticker.isFF = function(){
    return Array.every?true:false;
  }; // Firefox 1.5+
	
	websticker.isMac = function(){
    return navigator.platform.indexOf("Mac")!=-1?true:false;
  };
  
  websticker.isFF2 = function(){
    return typeof window.Iterator!='undefined'?true:false;
  }; //Firefox 2
  
  websticker.isIE7 = function(){
    return (window.XMLHttpRequest && document.all)?true:false;
  };

	websticker.detect_doctype = function (){
		var re=/\s+(X?HTML)\s+([\d\.]+)\s*([^\/]+)*\//gi;
		if(typeof(document.namespaces) != "undefined"){
			if (document.all[1].nodeType==8 && document.all[1].nodeValue!=null && document.all[1].nodeValue.substring(0,4)=='CTYP')
				return re.exec(document.all[1].nodeValue)[1];
			else if (document.all[0].nodeType==8 && document.all[0].nodeValue!=null && document.all[0].nodeValue.substring(0,4)=='CTYP')
				return re.exec(document.all[0].nodeValue)[1];
			else
				return null;
		}
		else{
			if(document.doctype != null)
				return re.exec(document.doctype.publicId)[1];
			else
				return null;
		}
	};

	if (websticker.detect_doctype() == 'XHTML')
		websticker.doctype=1;
	else
		websticker.doctype=1;
	
	websticker.checkOffset = function(){
		var pIE_X,pIE_Y,pFF_X,pFF_Y;
			// Default : BottomRight
			if (websticker.doctype){
				pIE_X = document.documentElement.clientWidth - 300 - 20; //deduct 25 for scrolling bar
				pIE_Y = document.documentElement.clientHeight - 250 - 20;
			}else{
			pIE_X = window.document.body.clientWidth - 300 -20;
			pIE_Y = window.document.body.clientHeight - 250 -20;
			}
			pFF_X = window.innerWidth - 15 - 300;
			pFF_Y = window.innerHeight - 15 - 250;
		if (websticker.position === 'TopRight'){
			if (websticker.doctype){
				pIE_X = document.documentElement.clientWidth - 300;
				pIE_Y = document.documentElement.clientHeight - 250;
			}
			else{
				pIE_X = window.document.body.clientWidth - 300;
				pIE_Y = window.document.body.clientHeight - 250;
			}
			pIE_Y = 0;
			pFF_X = window.innerWidth - 15 - 300;
			pFF_Y = 0;
			}
		if (websticker.position === 'TopLeft'){
			pIE_X = 0;
			pIE_Y = 0;
			pFF_X = 0;
			pFF_Y = 0;
			}		
		if (websticker.position === 'BottomLeft'){
			pIE_X = 0;
			if (websticker.doctype)
				pIE_Y = document.documentElement.clientHeight - 250;
			else
				pIE_Y = window.document.body.clientHeight - 250;
			pFF_X = 0;
			pFF_Y = window.innerHeight - 15 - 250;
			}	
		if (websticker.position === 'BottomMiddle'){
			if (websticker.doctype){
				pIE_X = Math.round((document.documentElement.clientWidth - 300)/2);
				pIE_Y = document.documentElement.clientHeight - 250;
			}
			else{
				pIE_X = Math.round((window.document.body.clientWidth - 300)/2);
				pIE_Y = window.document.body.clientHeight - 250;
			}
			pFF_X = Math.round((window.innerWidth - 15 - 300)/2);
			pFF_Y = window.innerHeight - 15 - 250;
			}
		if (websticker.position === 'TopMiddle'){
			if (websticker.doctype)
				pIE_X = Math.round((document.documentElement.clientWidth - 300)/2);
			else
				pIE_X = Math.round((window.document.body.clientWidth - 300)/2);
			pIE_Y = 0;
			pFF_X = Math.round((window.innerWidth - 15 - 300)/2);
			pFF_Y = 0;
			}				
		if (websticker.isIE){
			if (websticker.doctype){
				websticker.Ypos=document.documentElement.scrollTop + pIE_Y;
				websticker.Xpos=document.documentElement.scrollLeft + pIE_X;
			}
			else{
				websticker.Ypos=document.body.scrollTop + pIE_Y;
				websticker.Xpos=document.body.scrollLeft + pIE_X;
			}
		} else if (websticker.isFF){
			websticker.Ypos=window.pageYOffset + pFF_Y;
			websticker.Xpos=window.pageXOffset + pFF_X;
			alert('ff');
		} 
		if (isChrome()) {
			websticker.Ypos=window.pageYOffset + pFF_Y;
			websticker.Xpos=window.pageXOffset + pFF_X;
		}
	};

	websticker.toFixLayer = function(){
		websticker.checkOffset();
		var Y = parseInt(document.getElementById('ndExpandLayer_93034').style.top);
		var X = parseInt(document.getElementById('ndExpandLayer_93034').style.left);
		if (Y!==websticker.Ypos){
			var Ydif = websticker.Ypos - Y;		
			var YStep = Math.ceil(Ydif/websticker.speed);
			if (YStep===0){YStep=-1;}
			document.getElementById('ndExpandLayer_93034').style.top = (Y+YStep)+'px';
		}
		if (X!==this.Xpos){
			var Xdif = websticker.Xpos - X;
			var XStep = Math.ceil(Xdif/websticker.speed);
			if (XStep===0){XStep=-1;}
			document.getElementById('ndExpandLayer_93034').style.left = (X+XStep)+'px';	
		}		
		var postIt = setTimeout('websticker.toFixLayer()',10);
	};

	websticker.dismiss = function(){
		document.getElementById('ndExpandLayer_93034').style.display = 'none';
	};


	websticker.positBanner = function(){
		// Expanded Layer
		document.write("<div id=\"ndExpandLayer_93034\" style=\"position:absolute; " + "width:300px; height:250px; z-index:699; display: none;\">");
		document.write("<div id = 'widget'></div>");
		
    var flashvars = {
      clickTAG: 'http://hk.promotions.yahoo.com/music/nokiax6/',
      clickTAG2: 'http://www.uwants.com',
      clickTAG3: 'http://mytv.tvb.com/music',
      clickTAG4: 'http://www.alivenotdead.com/nokia',
      clickTAG5: 'http://www.youtube.com/NokiaX6hongkong',
      clickTAG6: 'http://www.nokia.com.hk/NOKIA_HONGKONG_86/Explore_services/Nokia_Play/x6.html'
    }
    var params = {
      wmode: "transparent"
    }
    var attributes = {
      name: "swfObj", 
      id: "swfObj"
    }
    swfobject.embedSWF('uwantsROMFwidgetAd32.swf', "widget", "300", "250", "9.0.0", "expressInstall.swf", flashvars, params, attributes);
    document.write("</div>");	
	};
	
  websticker.positBanner();
  var t = setInterval(init, 2000);
	
	function isChrome() {
    var is_chrome =  navigator.userAgent.toLowerCase().indexOf('chrome')  > -1;
    return is_chrome;
	}
		
	function init() {
		document.getElementById('ndExpandLayer_93034').style.top = websticker.Ypos+'px';
		document.getElementById('ndExpandLayer_93034').style.left = websticker.Xpos+'px';
		document.getElementById('ndExpandLayer_93034').style.display='inline';
    clearInterval(t);
		websticker.checkOffset();
		websticker.toFixLayer();
	}
