/*Class declaration for RichMedia Object*/
function RichMediaAd() {
	this._servingSite;
	this._clickURL;
	this._uniqueClientID;
	this._browserType;
	this._colWidth;
	this._colHeight;
	this._expWidth;
	this._expHeight;
	this._isIFrame = 0;
	this._expDirection;
	this._swfURL;
	this._flashVer = "8.0.0";
}

//Prototype properties for RichMediaObject
RichMediaAd.prototype._servingSite;
RichMediaAd.prototype._clickURL;
RichMediaAd.prototype._uniqueClientID;
RichMediaAd.prototype._browserType;
RichMediaAd.prototype._colWidth;
RichMediaAd.prototype._colHeight;
RichMediaAd.prototype._expWidth;
RichMediaAd.prototype._expHeight;
RichMediaAd.prototype._isIFrame;
RichMediaAd.prototype._expDirection;
RichMediaAd.prototype._swfURL;
RichMediaAd.prototype._flashVer;

/*Get offset of position based on expand direction and widths and heights*/
RichMediaAd.prototype.getOffSetForDraw = function() {
	try{
			
		var offset;
		
		switch(this._expDirection){
			case "Down":
				offset = "top:0px;left:0px;";
				return offset;
				break;
			case "Up":
				break;
			case "Left":
				var Loffset ="left:-" + (parseInt(this._expWidth) - parseInt(this._colWidth)) + "px;";
				var Toffset = "top:0px;"
				offset = Toffset + Loffset;
				return offset;
				break;
			case "Right":
				offset = "top:0px;left:0px";
				return offset;
				break;
		}
	}
	catch(e){}
}


/*Start Creating Embed Object tags for swf and divs around it*/

RichMediaAd.prototype.writeSWFObjectCode = function() {
	/*unique div id to find specific ad when expanding*/
	try{
		var mainDivID = this._uniqueClientID +"_"+ this._colWidth +"x"+ this._colHeight;
		var embedZoneID ="AD_"+ this._uniqueClientID +"_"+ this._colWidth +"x"+ this._colHeight +"_embed";
		var OffsetForDraw = this.getOffSetForDraw();
		var	TopStyle = "style=\"position:relative; width:"+ this._colWidth +"px;height:"+ this._colHeight +"px;\"";
		var	OuterStyle = "style=\"position:relative; width:"+ this._colWidth +"px;height:"+ this._colHeight +"px;\"";
		var	InnerStyle = "style=\"position:absolute; width:"+ this._colWidth +"px;height:"+ this._colHeight +"px;overflow:hidden; \"";
		
		/*if(this._servingSite == "travelagewest"){var	InnerStyle = "style=\"position:absolute; width:"+ this._colWidth +"px;height:"+ this._colHeight +"px;overflow:hidden;right:0px; \"";}*/
		var extraStyle = "right:auto;";
		if (this._servingSite == "travelagewest") {
			if (this._colWidth == 300 && this._colHeight == 250) {
				extraStyle = "right:0;";
			}					
		}
		
		//draw topmost div based on browser
		switch(this._browserType){
			case "IE8x":
			
			document.write("<div id='AD_"+ mainDivID +"'"+ TopStyle+">");
				//draw outer div
				document.write("<div id='AD_"+ mainDivID +"_Outer' " + OuterStyle + ">");
					//draw inner div
					document.write("<div id='AD_"+ mainDivID +"_Inner' " + InnerStyle + ">");
					if(this._servingSite == "mcmag" || this._servingSite == "meetings-conventions")document.write("<style>#header {overflow:visible !important;}#ad_006 {overflow:visible !important;}</style>");
					if(this._servingSite == "incentivemag")document.write("<style>#sidebar {overflow:visible !important;}.ad {overflow:visible !important;}</style>");

			break;
			case "IE7x":
			if(this._expDirection == "Right" || this._expDirection == "Top"){
				InnerStyle = "style=\"position:absolute; width:"+ this._colWidth +"px;height:"+ this._colHeight +"px;overflow:hidden;"+ OffsetForDraw + " \"";
			}
			 if(this._colWidth == "970"){
				InnerStyle = "style=\"position:relative; width:"+ this._colWidth +"px;height:"+ this._colHeight +"px;overflow:hidden;"+ OffsetForDraw + " \"";
			}
			document.write("<div id='AD_"+ mainDivID +"'"+ TopStyle+">");
				//draw outer div
				document.write("<div id='AD_"+ mainDivID +"_Outer' " + OuterStyle + ">");
					//draw inner div
					document.write("<div id='AD_"+ mainDivID +"_Inner' " + InnerStyle + ">");
					if(this._servingSite == "mcmag" || this._servingSite == "meetings-conventions")document.write("<style>#header {overflow:visible !important;}#ad_006 {overflow:visible !important;}</style>");
					if(this._servingSite == "incentivemag")document.write("<style>#sidebar {overflow:visible !important;}.ad {overflow:visible !important;}</style>");
			break;
			case "IE6x":
			if(this._expDirection == "Right" || this._expDirection == "Top"){
				InnerStyle = "style=\"position:absolute; width:"+ this._colWidth +"px;height:"+ this._colHeight +"px;overflow:hidden;"+ OffsetForDraw + " \"";
			}
			document.write("<div id='AD_"+ mainDivID +"'"+ TopStyle+">");
				//draw outer div
				document.write("<div id='AD_"+ mainDivID +"_Outer' " + OuterStyle + ">");
					//draw inner div
					document.write("<div id='AD_"+ mainDivID +"_Inner' " + InnerStyle + ">");
					if(this._servingSite == "mcmag" || this._servingSite == "meetings-conventions")document.write("<style>#header {overflow:visible !important;}#ad_006 {overflow:visible !important;}</style>");
					if(this._servingSite == "incentivemag")document.write("<style>#sidebar {overflow:visible !important;}.ad {overflow:visible !important;}</style>");

					
			break;
			case "IE5x":
			document.write("<div id='AD_"+ mainDivID +"'"+ TopStyle+">");
				//draw outer div
				document.write("<div id='AD_"+ mainDivID +"_Outer' " + OuterStyle + ">");
					//draw inner div
					document.write("<div id='AD_"+ mainDivID +"_Inner' " + InnerStyle + ">");
					if(this._servingSite == "mcmag" || this._servingSite == "meetings-conventions")document.write("<style>#header {overflow:visible !important;}#ad_006 {overflow:visible !important;}</style>");
					if(this._servingSite == "incentivemag")document.write("<style>#sidebar {overflow:visible !important;}.ad {overflow:visible !important;}</style>");
			break;
			case "FF3x":
			
			document.write("<div id='AD_"+ mainDivID +"'"+ TopStyle+">");
				//draw outer div
				document.write("<div id='AD_"+ mainDivID +"_Outer' " + OuterStyle + ">");
					//draw inner div
					document.write("<div id='AD_"+ mainDivID +"_Inner' " + InnerStyle + ">");
					//if mcmag add this code
					if(this._servingSite == "mcmag" || this._servingSite == "meetings-conventions")document.write("<style>#header {overflow:visible !important;}#ad_006 {overflow:visible !important;}</style>");
					if(this._servingSite == "incentivemag")document.write("<style>#sidebar {overflow:visible !important;}.ad {overflow:visible !important;}</style>");

			break;
			case "FF2x":

			document.write("<div id='AD_"+ mainDivID +"'"+ TopStyle+">");
				//draw outer div
				document.write("<div id='AD_"+ mainDivID +"_Outer' " + OuterStyle + ">");
					//draw inner div
					document.write("<div id='AD_"+ mainDivID +"_Inner' " + InnerStyle + ">");
					if(this._servingSite == "mcmag" || this._servingSite == "meetings-conventions")document.write("<style>#header {overflow:visible !important;}#ad_006 {overflow:visible !important;}</style>");
					if(this._servingSite == "incentivemag")document.write("<style>#sidebar {overflow:visible !important;}.ad {overflow:visible !important;}</style>");
					
			break;
			case "FF1x":
			document.write("<div id='AD_"+ mainDivID +"'"+ TopStyle+">");
				//draw outer div
				document.write("<div id='AD_"+ mainDivID +"_Outer' " + OuterStyle + ">");
					//draw inner div
					document.write("<div id='AD_"+ mainDivID +"_Inner' " + InnerStyle + ">");
					if(this._servingSite == "mcmag" || this._servingSite == "meetings-conventions")document.write("<style>#header {overflow:visible !important;}#ad_006 {overflow:visible !important;}</style>");
					if(this._servingSite == "incentivemag")document.write("<style>#sidebar {overflow:visible !important;}.ad {overflow:visible !important;}</style>");
			break;
			case "SAFARI":
			document.write("<div id='AD_"+ mainDivID +"'"+ TopStyle+">");
				//draw outer div
				document.write("<div id='AD_"+ mainDivID +"_Outer' " + OuterStyle + ">");
					//draw inner div
					document.write("<div id='AD_"+ mainDivID +"_Inner' " + InnerStyle + ">");
					if(this._servingSite == "mcmag" || this._servingSite == "meetings-conventions")document.write("<style>#header {overflow:visible !important;}#ad_006 {overflow:visible !important;}</style>");
					if(this._servingSite == "incentivemag")document.write("<style>#sidebar {overflow:visible !important;}.ad {overflow:visible !important;}</style>");
			break;
			case "CHROME":
			document.write("<div id='AD_"+ mainDivID +"'"+ TopStyle+">");
				//draw outer div
				document.write("<div id='AD_"+ mainDivID +"_Outer' " + OuterStyle + ">");
					//draw inner div
					document.write("<div id='AD_"+ mainDivID +"_Inner' " + InnerStyle + ">");
					if(this._servingSite == "mcmag" || this._servingSite == "meetings-conventions")document.write("<style>#header {overflow:visible !important;}#ad_006 {overflow:visible !important;}</style>");
					if(this._servingSite == "incentivemag")document.write("<style>#sidebar {overflow:visible !important;}.ad {overflow:visible !important;}</style>");

			break;
			default:
			document.write("<div id='AD_"+ mainDivID +"'"+ TopStyle+">");
				//draw outer div
				document.write("<div id='AD_"+ mainDivID +"_Outer' " + OuterStyle + ">");
					//draw inner div
					document.write("<div id='AD_"+ mainDivID +"_Inner' " + InnerStyle + ">");
					if(this._servingSite == "mcmag" || this._servingSite == "meetings-conventions")document.write("<style>#header {overflow:visible !important;}#ad_006 {overflow:visible !important;}</style>");
					if(this._servingSite == "incentivemag")document.write("<style>#sidebar {overflow:visible !important;}.ad {overflow:visible !important;}</style>");

			break;
		}
					document.write("<div id='pre"+ embedZoneID +"' style=\"" + extraStyle + "position:absolute;"+ OffsetForDraw +"\">");
					document.write("<div id='"+ embedZoneID +"'>");
						try{
							var flashvars = {};
							var params = {};
							params.wmode = "transparent";
							params.allowscriptaccess = "always";
							var attributes = {};
							swfobject.embedSWF(this._swfURL, embedZoneID, this._expWidth, this._expHeight, this._flashVer, false, flashvars, params, attributes);
						} 
						catch(e){
							//alert("Andrew Testing Live Ad Error:" + err);
						}
						
					document.write("</div>"); //embedzoneID
					document.write("</div>"); //preembedzoneid
				document.write("</div>");	  //ad_maindivid_inner
			document.write("</div>");		  //ad_maindivid_outer
		document.write("</div>");			  //ad_maindivid
	}
	catch(e){}
}

/* Check for width overload and then set width based on site and position*/
RichMediaAd.prototype.getExpandedWidth = function(optwidth) {
	try{
		if(optwidth != ''){
			this._expWidth = optwidth;
		}
		else {
			switch(this._servingSite){
				//check site first
				case "mcmag": case "meetings-conventions": case "incentivemag": case "successfulmeetings": case "travelagewest": case "travelweekly": 
					//check collapsed width for type of ad
					switch(this._colWidth){
						case "728":
							this._expWidth = "728";
							break;
						case "100":
							this._expWidth = "750";
							break;
						case "300":
							//mc right bar ad, now check height becuase there are different types
							switch(this._colHeight){
								case "100":
									this._expWidth = "854";
									break;
								case "250":
									this._expWidth = "600";
									break;
								case "600":
									this._expWidth = "705";
									break;
							}
							break;
						case "160":
							//mc right bar ad, now check height becuase there are different types
							switch(this._colHeight){
								case "600":
									this._expWidth = "300";
									break;
							}
							break;
					}
					break;
				default:
					//check collapsed width for type of ad
					switch(this._colWidth){
						case "970":
							this._expWidth = "970";
							break;
					}
					break;
				
			
			}
		}
	}
	catch(e){}
}

/* Check for height overload and then set height based on site and position */
RichMediaAd.prototype.getExpandedHeight = function(optheight){
	try{
		if(optheight != ''){
			this._expHeight = optheight;
		}
		else {
			switch(this._servingSite){
				//check site first
				case "mcmag": case "meetings-conventions": case "incentivemag": case "successfulmeetings": case "travelweekly":  
					//check collapsed Height for type of ad
					switch(this._colHeight){
						case "90":
							this._expHeight = "300";
							break;
						case "100":
							//mc right bar ad, now check width becuase there are different types
							switch(this._colWidth){
								case "300":
									this._expHeight = "400";
									break;
								case "100":
									this._expHeight = "600";
									break;
							}
							break;
						case "600":
							//mc right bar ad, now check width becuase there are different types
							switch(this._colWidth){
								case "160":
									this._expHeight = "600";
									break;
								case "300":
									this._expHeight = "600";
									break;
							}
							break;
						case "250":
							switch(this._colWidth){
								case "300":
									this._expHeight = "500";
									break;
							}
							break;
					}
					break;
				case "travelagewest":
					//check collapsed Height for type of ad
					switch(this._colHeight){
						case "66":
							this._expHeight = "418";
							break;
					}
					break;
				default:
					//check collapsed Height for type of ad
					switch(this._colHeight){
						case "66":
							this._expHeight = "418";
							break;
					}
					break;
			
			}
		}
	}
	catch(e){}
}

/* Get Expand Direction based on collapsed height and width and site */
RichMediaAd.prototype.getExpandDirection = function(expdirection){
	try{
		if(expdirection != ''){
			this._expDirection = expdirection;
		}
		else {
			switch(this._servingSite){
					//check site first
					case "mcmag": case "meetings-conventions": case "incentivemag": case "successfulmeetings": case "travelweekly": 
						//check collapsed Height for type of ad
						switch(this._colHeight){
							//MCLeaderboard
							case "90":
								switch(this._colWidth){
									case "728":
										this._expDirection = "Down";
										break;
								}
								break;
							//MCRight Column BB
							case "100":
								switch(this._colWidth){
									case "300":
										this._expDirection = "Left";
										break;
									case "100":
										this._expDirection = "Left";
										break;
										
								}
								break;
							//MC WideSky
							case "600":
								switch(this._colWidth){
									case "160":
										this._expDirection = "Left";
										break;
									//MC BigRectangle
									case "300":
										this._expDirection = "Left";
										break;
								}
								break;
							//MC Rectangle
							case "250":
								switch(this._colWidth){
									case "300":
										this._expDirection = "Left";
										break;
								}
								break;
						}
						break;
					case "travelagewest":
						switch(this._colHeight){
							//TAW has a 990 wide pushdown instead of 970
							case "66":
								switch(this._colWidth){
									case "990":
										this._expDirection = "Down";
										break;
								}
								break;
						}
						break;
					default:
					switch(this._colHeight){
						//pushdown
						case "66":
							switch(this._colWidth){
								case "970":
									this._expDirection = "Down";
									break;
							}
						break;
					}
					break;
			}
		}
	}
	catch(e){}
}
	
/*Inititalize Object With Data from QueryString*/
RichMediaAd.prototype.initFromQueryString = function(){
	try{
		//get script tag
		var scripts = document.getElementsByTagName('script');
		var myScript = scripts[ scripts.length - 1 ];
		//find only querystring from src
		var queryString = myScript.src.replace(/^[^\?]+\??/,'');
		//parse query string
		var params = this.parseQuery( queryString );
		
		this._uniqueClientID = params['CCID'];
	}
	catch(e){}
	
	try{
		//spits back only the domain name for easy comparison
		//WILL NEVER WORK OUTSIDE OF AMERICA
		var domain = params['referer'].toString().replace("http://","")
		domain = domain.split("/")[0];
		domain = domain.split(".")[domain.split(".").length -2];
		this._servingSite = domain;
	}
	catch(e){
		//default code eventually
	}
	
	try{
		this._clickURL = params['clicktag'];
	
		//calls browsercheck to return the name and version
		this._browserType = browserCheck();
		this._colWidth =  params['w'];
		this._colHeight = params['h'];
		//console.debug(this._colWidth);
		//console.debug(this._colHeight);
		//check for overloaded expanded width and height and then set expanded dimensions
		this.getExpandedWidth(params['optwidth']);
		this.getExpandedHeight(params['optheight']);
		this.getExpandDirection(params['expdirection']);
		this._isIFrame = 0;
		//swfurl contains all parameters to cover mispelled clicktags
		this._swfURL = params['adimage'] + "?clicktag=" + this._clickURL + "&clickTAG=" + this._clickURL + "&clickTag=" + this._clickURL + 
					   "&colwidth=" + this._colWidth + "&colheight=" + this._colHeight +"&expwidth=" + this._expWidth +"&expheight=" + this._expHeight +"&uniqueID=" + 			
					   this._uniqueClientID +"&expdirection=" + this._expDirection;
	
		this.writeSWFObjectCode();
	}
	catch(e){}
	
}




//querystring parser http://feather.elektrum.org/book/src.html
RichMediaAd.prototype.parseQuery = function( query ) {
   try{
	   var Params = new Object ();
	   if ( ! query ) return Params; // return empty object
	   var Pairs = query.split(/[;&]/);
	   for ( var i = 0; i < Pairs.length; i++ ) {
		  if(i ==1){
			var KeyVal = Pairs[i].split('clicktag=');
			 KeyVal[0] = "clicktag";
		  }
		  else if(i ==4){
			var KeyVal = Pairs[i].split('referer=');
			 KeyVal[0] = "referer";
		  }
		  else{
			  var KeyVal = Pairs[i].split('=');
		  }
		  
		  
		  //console.debug("keyval %s", KeyVal);
		  if ( ! KeyVal || KeyVal.length != 2 ) continue;
		  var key = unescape( KeyVal[0] );
		  var val = unescape( KeyVal[1] );
		  val = val.replace(/\+/g, ' ');
		  Params[key] = val;
		  //console.debug("param %s:  %s : %s", i, key, val);
	   }
	   return Params;
   }
   catch(e){}
}
	
//Browser Dectection Code
function browserCheck(){
	try{	
		if (/Firefox[\/\s](\d+\.\d+)/.test(navigator.userAgent)){ //test for Firefox/x.x or Firefox x.x (ignoring remaining digits);
			var ffversion=new Number(RegExp.$1) // capture x.x portion and store as a number
			if (ffversion>=3)
				return("FF3x")
			else if (ffversion>=2)
				return("FF2x")
			else if (ffversion>=1)
				return("FF1x")
			}
		else if (/MSIE (\d+\.\d+);/.test(navigator.userAgent)){ //test for MSIE x.x;
 			var ieversion=new Number(RegExp.$1) // capture x.x portion and store as a number
			if (ieversion>=8)
				return("IE8x")
			else if (ieversion>=7)
				return("IE7x")
			else if (ieversion>=6)
				return("IE6x")
			else if (ieversion>=5)
				return("IE5x")
		}
		else if (/Safari/.test(navigator.userAgent)){ //test for MSIE x.x;
 			var ieversion=new Number(RegExp.$1) // capture x.x portion and store as a number
			return("SAFARI");
		}
		else if (/Chrome/.test(navigator.userAgent)){ //test for Chrome x.x;
 			return("CHROME")
		}
		else{
			return("OTHER");
		}
	}
	catch(e){}
}

//The global Expansion Function
function RichMediaExpand(uniqueID, colwidth, colheight, expwidth, expheight, expdirection) {
	try{
		var browser = browserCheck();
		var divToModifyID = "AD_" + uniqueID +"_"+ colwidth +"x"+ colheight +"_Outer";
		var innerDivToModifyID = "AD_" + uniqueID +"_"+ colwidth +"x"+ colheight +"_Inner";
		var preEmbedID = "preAD_" + uniqueID +"_"+ colwidth +"x"+ colheight +"_embed";
		
		var actualDiv = document.getElementById(divToModifyID);
		var innerDiv = document.getElementById(innerDivToModifyID);
		var preEmbedDiv = document.getElementById(preEmbedID);
		var topMostDiv = actualDiv.parentNode.parentNode;
		//OUTER
		//actualDiv.style.width = expwidth + "px";
		//actualDiv.style.height = expheight + "px";
		//INNER
		innerDiv.style.width = expwidth + "px";
		innerDiv.style.height = expheight + "px";
		innerDiv.style.zIndex = "9999";
		//preEmbedDiv.style.zIndex = "9999";
	
			
		//TOP DIV
		if(browser == "IE7x"){
			topMostDiv.style.zIndex = "9999";
			topMostDiv.style.position = "relative";
			
			if (document.getElementById("header")) {
				document.getElementById("header").style.zIndex = "9999";
			}
			if (document.getElementById("main")) {
				document.getElementById("main").style.zIndex = "0";
			}
		}
		
		if(expdirection == "Left"){
			innerDiv.style.left = "-"+	(parseInt(expwidth) - parseInt(colwidth)) + "px";
			preEmbedDiv.style.left = "0px";
		}
		
		if(colwidth == "970" && colheight == "66"){
			topMostDiv.style.height = expheight + "px";
		}
		if(colwidth == "990" && colheight == "66"){
			topMostDiv.style.height = expheight + "px";
			console.log(expheight + "px");
		}
		if(colwidth == "300" && colheight == "100"){
			var obj_y = GetObjY(actualDiv);
			var view_h = GetHeight();
			var view_y = GetScrollY();
			var intDistFromBottom = view_h + view_y - obj_y;
					var intDistFromTop = view_h - intDistFromBottom;
					if (parseInt(expheight) < view_h) {
						if (intDistFromBottom < parseInt(expheight)) {
							var intScrollDistance = obj_y - (view_h - parseInt(expheight)-parseInt(colheight));
							window.scroll(0,intScrollDistance);
						}
					}
					else {
						window.scroll(0,obj_y);
					}
		}
	}
	catch(e){}
}
//The global Collapse Function
function RichMediaCollapse(uniqueID, colwidth, colheight, expwidth, expheight, expdirection) {
	try{
		var browser = browserCheck();
		var divToModifyID = "AD_" + uniqueID +"_"+ colwidth +"x"+ colheight +"_Outer";
		var innerDivToModifyID = "AD_" + uniqueID +"_"+ colwidth +"x"+ colheight +"_Inner";
		var preEmbedID = "preAD_" + uniqueID +"_"+ colwidth +"x"+ colheight +"_embed";
		
		var actualDiv = document.getElementById(divToModifyID);
		var innerDiv = document.getElementById(innerDivToModifyID);
		var preEmbedDiv = document.getElementById(preEmbedID);
		var topMostDiv = actualDiv.parentNode.parentNode;
		
		
			//OUTER
			actualDiv.style.width = colwidth + "px";
			actualDiv.style.height = colheight + "px";
			//INNER
			innerDiv.style.width = colwidth + "px";
			innerDiv.style.height = colheight + "px";
			innerDiv.style.zIndex = "";
			//TOP DIV
			if(browser == "IE7x"){
				topMostDiv.style.zIndex = "";
				topMostDiv.style.position = "";
			}
			if(colwidth == "970" && colheight == "66"){
				topMostDiv.style.height = colheight + "px";
			}
			if(colwidth == "990" && colheight == "66"){
				topMostDiv.style.height = colheight + "px";
			}
			if(expdirection == "Left"){
				preEmbedDiv.style.left = "-"+	(parseInt(expwidth) - parseInt(colwidth)) + "px";
				innerDiv.style.left = "0px";
			}
			if(colwidth == "300" && colheight == "100"){
				window.scroll(0,0);
			}
		
	}
	catch(e){}
}
//DC Scroll Code Reused
function GetObjY(obj) {
	return (obj.offsetParent ? obj.offsetTop + GetObjY(obj.offsetParent) : obj.y ? obj.y : 0);
}

function GetHeight() {
	var height = 0;
	if (typeof(window.innerHeight) == "number") {
		height = window.innerHeight;
	} else if (document.documentElement && document.documentElement.clientHeight) {
		height = document.documentElement.clientHeight;
	} else if (document.body && document.body.clientHeight) {
		height = document.body.clientHeight;
	}
	return height;
}

function GetScrollY() {
	var scrollY = 0;
	if (typeof(window.pageYOffset ) == "number") {
		scrollY = window.pageYOffset;
	} else if (document.body && document.body.scrollTop) {
		scrollY = document.body.scrollTop;
	} else if (document.documentElement && document.documentElement.scrollTop) {
		scrollY = document.documentElement.scrollTop;
	}
	return scrollY;
}
