// JavaScript Document

function getPageSize(){
	
	var xScroll, yScroll;
	
	if (window.innerHeight && window.scrollMaxY) {	
		xScroll = document.body.scrollWidth;
		yScroll = window.innerHeight + window.scrollMaxY;
	} else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
		xScroll = document.body.scrollWidth;
		yScroll = document.body.scrollHeight;
	} else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
		xScroll = document.body.offsetWidth;
		yScroll = document.body.offsetHeight;
	}
	
	var windowWidth, windowHeight;
	if (self.innerHeight) {	// all except Explorer
		windowWidth = self.innerWidth;
		windowHeight = self.innerHeight;
	} else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
		windowWidth = document.documentElement.clientWidth;
		windowHeight = document.documentElement.clientHeight;
	} else if (document.body) { // other Explorers
		windowWidth = document.body.clientWidth;
		windowHeight = document.body.clientHeight;
	}	
	
	// for small pages with total height less then height of the viewport
	if(yScroll < windowHeight){
		pageHeight = windowHeight;
	} else { 
		pageHeight = yScroll;
	}

	// for small pages with total width less then width of the viewport
	if(xScroll < windowWidth){	
		pageWidth = windowWidth;
	} else {
		pageWidth = xScroll;
	}


	arrayPageSize = new Array(pageWidth,pageHeight,windowWidth,windowHeight) 
	return arrayPageSize;
}



function CloseFooterWindow(){
	document.getElementById('theWindow').style.display='none';
	document.getElementById('objStr_overlay').style.display='none';
	}

function initSkinnyBox()
{
	
	if (!document.getElementsByTagName){ return; }
	var anchors = document.getElementsByTagName("a");

	// loop through all anchor tags
	for (var i=0; i<anchors.length; i++){
		var anchor = anchors[i];

		if (anchor.getAttribute("href") && (anchor.getAttribute("rel") == "skinnybox")){
			anchor.onclick = function () {showSkinnybox(this); return false;}
			
		}
      /*var footStyles=document.getElementById('dyn_footer').style;
      footStyles.color='#000000';
      footStyles.lineHeight='20px';*/
	}
	
function showSkinnybox(objLink)
{
	//var objHyperlink = document.getElementById('hyperlink');
	//var newLink = document.getElementById('theLink');
	//var theLink = objLink.getAttribute('href');
	//var theLinkText = objLink.getAttribute('title');
	var arrayPageSize = getPageSize();
	//newLink.innerHTML = '<a href="'+theLink+'"><img src="https://sites.bridgevine.com/WebImageHandler.ashx?WebImageUUID=375d553b-407b-4263-9d4e-9fba04708970&UseCaching=False&CacheVersion=9872d49e-7395-498c-91d3-90d5baf1ef30&{#version#}" width="75" height="22" border="0"/></a>'
	//objHyperlink.innerHTML = '<a href="'+theLink+'" target="_blank">'+theLinkText+'</a>';
	createOverlay();
	createTheWindow();
	
	
}
function createTheWindow(){
    if (navigator.appVersion.indexOf('MSIE 6.0') != -1){

 	var objWindow=document.getElementById('theWindow').style;
	objWindow.display='block';
 	objWindow.position='absolute';
	objWindow.height='200px';
	objWindow.width='448px';
	objWindow.zIndex='3200';
	objWindow.left='50%';
	objWindow.marginLeft='-224px';
	objWindow.top='100px';
    //objWindow.top= (arrayPageSize[1]/2 + 'px');
	
	}else{
	
    var objWindow=document.getElementById('theWindow').style;
	objWindow.display='block';
 	objWindow.position='fixed';
	objWindow.height='200px';
	objWindow.width='448px';
	objWindow.zIndex='3200';
	objWindow.left='50%';
	objWindow.marginLeft='-224px';
	objWindow.top='100px';
    //objWindow.top= (arrayPageSize[1]/2 + 'px');
	
	}
}

function createOverlay() {
     var objBody = document.getElementsByTagName("body").item(0);
     var objOverlay = document.createElement("div");
	 objOverlay.setAttribute('id','objStr_overlay');
	 objOverlay.onclick = function () {CloseFooterWindow(); return false;}
	 objOverlay.style.position= 'absolute';
	 objOverlay.style.zIndex= '2400';
	 objOverlay.style.display="block";
	 objOverlay.style.height = (arrayPageSize[1] + 'px');
	 objOverlay.style.top = '0';
	 objOverlay.style.left = '0';
	 objOverlay.style.backgroundColor="#000000"
	 objOverlay.style.opacity = (70 / 100); 
     objOverlay.style.MozOpacity = (70 / 100); 
     objOverlay.style.KhtmlOpacity = (70 / 100); 
     objOverlay.style.filter = "alpha(opacity=70)"; 
	 objOverlay.style.width = '100%';
	 objBody.insertBefore(objOverlay, objBody.firstChild);
	
	} 
	


}
 	if (window.addEventListener)
		window.addEventListener("load", initSkinnyBox, false)
		else if (window.attachEvent)
		window.attachEvent("onload", initSkinnyBox)
		else if (document.getElementById)
		window.onload=initSkinnyBox
		



document.write('<div id="theWindow" style="display:none;">');
/*document.write('<table width="448" height="259" border="0" cellspacing="0" cellpadding="0" style="background:url(https://sites.bridgevine.com/WebImageHandler.ashx?WebImageUUID=7f58570f-43a3-43fb-9e55-3d2538e0e11d&UseCaching=False&CacheVersion=3c82c258-40b6-46e4-adeb-686dd2b67323&{#version#}) no-repeat;"><tr><td height="19" colspan="2">&nbsp;</td>');
document.write('</tr><tr><td height="23" colspan="2" valign="top"><div align="right" style="padding-right:15px;"><a href="javascript:CloseFooterWindow();"><img src="https://sites.bridgevine.com/WebImageHandler.ashx?WebImageUUID=81bccb00-ed90-4b12-b42e-63fe9c70d6e4&UseCaching=False&CacheVersion=d81623e5-8979-43f8-9eef-cfb4bfe48858&{#version#}" width="63" height="23" border="0" /></a></div></td></tr><tr><td height="39" colspan="2"></td></tr><tr><td height="127"></td>');
document.write('<td valign="top"><p style="padding-left:16px;padding-top:10px; font-family:Trebuchet MS, Arial, Verdana; font-size:14px; color:#000000;">You are about to leave this page and return to the Offerwire<br /><span id="hyperlink"></span> page. </p>');
document.write('<p style="padding-left:16px;padding-top:10px; font-family:Trebuchet MS, Arial, Verdana; font-size:14px; color:#000000;">If you would like to proceed, please select Continue. Otherwise<br />please select Cancel to remain on the current page</p></td>');
document.write('</tr><tr><td colspan="2"></td></tr><tr><td height="51"></td>');
document.write('<td valign="top"><div align="right" style="padding-right:25px;"><span id="theLink"></span>');
document.write('<a href="javascript:CloseFooterWindow();"><img src="https://sites.bridgevine.com/WebImageHandler.ashx?WebImageUUID=5e7b9a8e-8328-4c39-b09f-ceda62ac0a9d&UseCaching=False&CacheVersion=747d2858-4200-4da5-877e-2a5d559717d8&{#version#}" width="75" heigh="22" border="0" /></a></div></td></tr></table>');
document.write('</div></div>');*/
document.write('<a href="javascript:CloseFooterWindow();"><img src="/assets/hmstyle/assets/images/cb_bg.gif" border="0"></a>');
document.write('</div>');

/*document.write('<style>');
document.write('#dyn_footer p{color:#666666;}');
document.write('#dyn_footer a{text-decoration:none;color:#0D83C8;}');
document.write('#dyn_footer a:hover{text-decoration:underline;color:#0D83C8;}');
document.write('</style>');

document.write('<div style="width:960px; margin-left:auto;margin-right:auto;color:#000000;" id="dyn_footer">');
document.write('<p align="center" style="height: 20px"><span style="line-height: 16px; font-size: 12px"><a  rel="skinnybox" href="http://www.offerwire.com/index/partner.aspx" title="Shop By Brands">Shop By Brand </a>| <a href="http://www.offerwire.com/index/bundle_save.aspx" rel="skinnybox" title="Bundles">Bundles</a> | <a href="http://www.offerwire.com/index/high_speed_internet.aspx" rel="skinnybox" title="High Speed Internet">High Speed Internet </a>| <a href="http://www.offerwire.com/index/tv_services.aspx" rel="skinnybox" title="TV Services">TV Services </a>| <a href="http://www.offerwire.com/index/phone_services.aspx" rel="skinnybox" title="Phone Services">Phone Services</a><br />');
document.write('</span></p>');
document.write('<p align="center" style="line-height: 16px; font-size: 12px"><a href="http://www.offerwire.com/index.aspx" rel="skinnybox" title="Home">Home </a>| <a href="http://www.offerwire.com/index/about_us.aspx" rel="skinnybox" title="About Us">About Us</a> | <a href="http://rebates.offerwire.com" rel="skinnybox" title="Rebates">Rebates</a> | <a href="http://www.offerwire.com/index/check_order_status.aspx" rel="skinnybox" title="Order Status">Order Status</a> | <a href="http://www.offerwire.com/index/customer_care.aspx" rel="skinnybox" title="Contact Us">Contact Us</a> | <a href="http://www.offerwire.com/privacy.aspx" rel="skinnybox" title="Privacy Policy">Privacy Policy</a> | <a href="http://www.offerwire.com/terms.aspx" rel="skinnybox" title="Terms of Use">Terms of Use</a> | <a href="http://www.offerwire.com/FAQ.aspx" rel="skinnybox" title="FAQs">FAQs</a> </p>');
document.write('<p align="center"><a href="http://www.comcastspecial.com " rel="skinnybox" title="Comcast Special">www.comcastspecial.com </a>| <a href="http://www.timewarnercablespecial.com " rel="skinnybox" title="Time Warner Cable Special">www.timewarnercablespecial.com </a>| <a href="http://www.qwestspecial.com " rel="skinnybox" title="Qwest Special">www.qwestspecial.com </a>| <a href="http://www.charterspecial.com " rel="skinnybox" title="Charter Special">www.charterspecial.com </a><br> <a href="http://www.pricecheater.com " rel="skinnybox" title="Price Cheater">www.pricecheater.com </a>| <a href="http://www.guidedmove.com" rel="skinnybox" title="Guided Move">www.guidedmove.com </a>| <a href="http://www.mychangeaddress.com" rel="skinnybox" title="Change Address">www.mychangeaddress.com </a>| <a href="http://www.bridgevinebusiness.com/" rel="skinnybox" title="Bridgevine Business">www.bridgevinebusiness.com</a> </p>');
document.write('<br><p align="center"><span style="color:#000000;">Follow us on</span><br /><a href="http://twitter.com/offerwireceo" rel="skinnybox" title="Twitter"><img width="81" height="19" alt="" border="0" src="https://sites.bridgevine.com/resources/ow/twitter_logo.gif" /></a></p>');
//document.write('<p align="center">© 2009 Offerwire.com - All rights reserved. </p>');
//document.write('<p style="line-height: 16px; font-size: 12px"><br /></p>');
document.write('</div>');
*/