function getImageSpecs(){

var PopImg=document.getElementById('popImage');

for( var x = 0; x<PopImg.attributes.length;x++){
	if(PopImg.attributes[x].nodeName.toLowerCase() == 'width'){
		var w=PopImg.attributes[x].nodeValue;
	}
        if(PopImg.attributes[x].nodeName.toLowerCase() == 'height'){
                var h=PopImg.attributes[x].nodeValue;
        }
        if(PopImg.attributes[x].nodeName.toLowerCase() == 'src'){
                var src=PopImg.attributes[x].nodeValue;
        }
        if(PopImg.attributes[x].nodeName.toLowerCase() == 'alt'){
                var alt=PopImg.attributes[x].nodeValue;
        }
}


//alert('width is:'+w+', height is:'+h);
arrayImageSize = new Array(w,h,src,alt);
	return arrayImageSize;
}

function getImageLink(){

var PopImg=document.getElementById('popImage');
for( var x = 0; x<PopImg.parentNode.attributes.length;x++){
	if(PopImg.parentNode.attributes[x].nodeName.toLowerCase() == 'href'){
		var l=PopImg.parentNode.attributes[x].nodeValue;
	}
}

//alert(l);
return l;
}

function slide(){

if (document.getElementById('popImage')){
var PopInfo=document.getElementById('popInfo');
var PopImg=document.getElementById('popImage');
var iHxW=getImageSpecs();

var link=getImageLink();

PopImg
PopImg.attributes
//alert(PopInfo.innerHTML);
var sysTst;
                var HxW=getPageSizeWithScroll();
                var scrollXY=getScrollXY();




sysTst=getCookie("newStoreHrs");
if(!sysTst){

if(!document.getElementById('slideContainer')){
		var ni=document.body;
		var slideContainerDiv1 = document.createElement('div');
                var divId1 = 'slideContainer';
		slideContainerDiv1.setAttribute('id',divId1);
		var divId1Styles = 'position:absolute; top:-10000px; left:-10000px;opacity:0.7;filter:alpha(opacity=70)';
		slideContainerDiv1.setAttribute('style',divId1Styles);
		ni.appendChild(slideContainerDiv1);

}

	var slideBox=document.getElementById('slideContainer');
	var buffer;

	var sHeight = HxW[1];
	var sWidth = HxW[0];
//alert(sHeight+', '+sWidth);

	slideBox.style.position="absolute";
	slideBox.style.filter="alpha(opacity=70)";
	slideBox.style.top = "0px";
	slideBox.style.left = "0px";
	slideBox.style.width = sWidth + "px";
	slideBox.style.height = sHeight + "px";
	slideBox.style.backgroundColor = "#000000";
	slideBox.style.zIndex = "100";


	var bWidth, bHeight;
	var bPosX,bPosY;
iHxW
        bWidth=iHxW[0];
        bHeight=iHxW[1];

//	bWidth="441";
//	bHeight="297";
	bMar="10";

	//bPosX = (screen.width-bWidth)/2;
	//bPosY = ((screen.height - bHeight)/2) -130;
bPosX=(document.all?document.body.clientWidth:window.innerWidth)/2;
bPosY=(document.all?document.body.clientHeight:window.innerHeight)/2;
//bPosY=bPosY - 130;
bPosX=bPosX-(bWidth/2);
bPosY=bPosY-(bHeight/2);

if(!document.getElementById('bannerNote')){
                var nb=document.body;
                var bannerNoteDiv1 = document.createElement('div');
                var divId2 = 'bannerNote';
                bannerNoteDiv1.setAttribute('id',divId2);
                var divId2Styles = 'position:absolute; top:-10000px; left:-10000px;';
                bannerNoteDiv1.setAttribute('style',divId2Styles);
                nb.appendChild(bannerNoteDiv1);
}

	var bannerNote=document.getElementById('bannerNote');
	bannerNote.style.position="absolute";
	bannerNote.style.top=bPosY+'px';
	bannerNote.style.left=bPosX+'px';
	bannerNote.style.height=bMar+'px';
	bannerNote.style.width=bWidth+'px';
	bannerNote.style.zIndex='110';


if(!document.getElementById('bannerNoteClose')){
                var bnb=document.getElementById('bannerNote');
                var bannerNoteCloseDiv1 = document.createElement('div');
                var divId4 = 'bannerNoteClose';
                bannerNoteCloseDiv1.setAttribute('id',divId4);
                bnb.appendChild(bannerNoteCloseDiv1);
}
var bnc=document.getElementById('bannerNoteClose');
bnc.style.textAlign="right";
bnc.style.height="25px";
bnc.style.width=bWidth+"px";
bnc.style.float="left";

bnc.innerHTML='<a href="javascript:slideOff();" class="bodyLink" style="color:#dddddd">Close</a>';

if(!document.getElementById('bannerNoteb')){
                var bn=document.getElementById('bannerNote');
                var bannerNotebDiv1 = document.createElement('div');
                var divId3 = 'bannerNoteb';
                bannerNotebDiv1.setAttribute('id',divId3);
//                var divId3Styles = 'position:absolute; top:-10000px; left:-10000px;opacity:0.7;filter:alpha(opacity=70)';
//                bannerNotebDiv1.setAttribute('style',divId3Styles);
                bn.appendChild(bannerNotebDiv1);
}

	var bannerNoteb=document.getElementById('bannerNoteb');
	bannerNoteb.style.height=bHeight+'px';
	bannerNoteb.style.width=bWidth+'px';
	bannerNoteb.style.backgroundColor='#ffffff';
	bannerNoteb.style.color="#000000";
       bannerNoteb.style.backgroundColor='transparent';

/*
	buffer = '<div id="banner-note" style="';
	buffer += 'position:absolute;';
	buffer += 'top:'+bPosY+'px;';
	buffer += 'left:'+bPosX+'px;';
	buffer += 'height:'+bMar+'px;';
	buffer += 'width:'+bWidth+'px;';
	buffer += 'z-index:110;';
	buffer += '">';
	buffer += '<div id="banner-notea" style="';
	buffer += 'height:'+bHeight+'px;';
	buffer += 'width:'+bWidth+'px;';
	buffer += 'float:left;';
	buffer += 'background-color:#ffffff;';
	buffer += 'color:#000000;';
	buffer += 'font-family:sans-serif;';
	buffer += 'font-size:14px;';
	buffer += 'border:2px solid #CC7E48;';
	buffer += 'text-align:right';
	buffer += '">';
*/
//alert(iHxW[2]);
	buffer = '<img src="'+iHxW[2]+'" style="float:left; border:0px; cursor:pointer;" onclick="postPage()" />';
/*
	buffer += '</div>';
	buffer += '<div style="float:left;height:25px;width:278px;text-align:right;"><a href="javascript:slideOff();" class="bodyLink" style="color:#dddddd">Close</a></div></div>';
*/
	//slideBox.innerHTML=buffer;
//	document.body.innerHTML += buffer;
/*
if(!document.getElementById('bannerNoteClose')){
                var bn=document.getElementById('bannerNote');
                var bannerNoteCloseDiv1 = document.createElement('div');
                var divId4 = 'bannerNoteClose';
                bannerNoteCloseDiv1.setAttribute('id',divId4);
                bn.appendChild(bannerNoteCloseDiv1);
}
*/
//var bnc=document.getElementById('bannerNoteClose');
//bnc.style.textAlign="right";
//bnc.style.height="25px";
//bnc.style.width=bWidth+"px";
//bnc.innerHTML='<a href="javascript:slideOff();" class="bodyLink" style="color:#ffffff">Close</a>';
bannerNoteb.innerHTML+=buffer;
//alert(bannerNoteb.innerHTML);
}else{
//doLoad();
}
}
}

function slideOff(){
	var slideBox=document.getElementById('slideContainer');
	var noteBox=document.getElementById('bannerNote');

	slideBox.style.top = "-10px";
	slideBox.style.left = "-10px";
	slideBox.style.width = "1px";
	slideBox.style.height = "1px";
	slideBox.style.backgroundColor = "#000000";
	
	noteBox.style.top = "-1000px";
	noteBox.style.left = "-1000px";
	noteBox.style.width = "1px";
	noteBox.style.height = "1px";
	noteBox.style.backgroundColor = "#000000";

var sysTst;
sysTst=getCookie("newStoreHrs");
if(!sysTst){
	//setCookie("storeHours","displayed","1");
	setCookie("storeHours");

//doLoad();
}
}

function postPage(){
slideOff();
//var url="http://www.k9loft.com/services/non-anesthetic-dental-cleaning.php";
//var url="http://www.k9loft.com/services/group-obedience-training.php";
//var url="http://www.hybrid-web.com/";
var url = getImageLink();

window.location=url;
}
function setCookie(what){
document.cookie="newStoreHrs="+what+";Path=/;";
}
function getCookie(Name) {
var search = Name + "="
var returnvalue = "";
if (document.cookie.length > 0) {
offset = document.cookie.indexOf(search)
// if cookie exists
if (offset != -1) { 
offset += search.length
// set index of beginning of value
end = document.cookie.indexOf(";", offset);
// set index of end of cookie value
if (end == -1) end = document.cookie.length;
returnvalue=unescape(document.cookie.substring(offset, end))
}
}
return returnvalue;
}


function setCookiea(c_name,value,expiredays)
{var exdate=new Date();exdate.setDate(exdate.getDate()+expiredays);
var urlD = "www.k9loft.com";

document.cookie=c_name+ "=" +escape(value)+
((expiredays==null) ? "" : ";expires=")+"path=/;"+"domain="+urlD+";";

} 

function setCookie_bu(c_name,value,expiredays)
{var exdate=new Date();exdate.setDate(exdate.getDate()+expiredays);
document.cookie=c_name+ "=" +escape(value)+
((expiredays==null) ? "" : ";expires="+exdate.toGMTString());
}

function getCookiea(c_name)
{
if (document.cookie.length>0)
  {
  c_start=document.cookie.indexOf(c_name + "=");
  if (c_start!=-1)
    { 
    c_start=c_start + c_name.length+1; 
    c_end=document.cookie.indexOf(";",c_start);
    if (c_end==-1) c_end=document.cookie.length;
    return unescape(document.cookie.substring(c_start,c_end));
    } 
  }
return "";
} 

function browser_check()
 {
 var name = navigator.appName;
 var version = parseInt(navigator.appVersion);

 }

function getPageSizeWithScroll(){


        if ((window.innerHeight!==undefined) && (window.scrollMaxY!==undefined)) {// Firefox
                yWithScroll = window.innerHeight + window.scrollMaxY;
                xWithScroll = window.innerWidth + window.scrollMaxX;
//alert( 'The height isa ' + yWithScroll + ' and the width is ' + xWithScroll );
        } else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
                yWithScroll = document.body.scrollHeight;
                xWithScroll = document.body.scrollWidth;
//alert( 'The height isb ' + yWithScroll + ' and the width is ' + xWithScroll );
        } else { // works in Explorer 6 Strict, Mozilla (not FF) and Safari
                yWithScroll = document.body.offsetHeight;
                xWithScroll = document.body.offsetWidth;

//alert( 'The height isc ' + yWithScroll + ' and the width is ' + xWithScroll );
        }
        arrayPageSizeWithScroll = new Array(xWithScroll,yWithScroll);
       // alert( 'The height is ' + yWithScroll + ' and the width is ' + xWithScroll );
        return arrayPageSizeWithScroll;
}

function getScrollXY() {
  var scrOfX = 0, scrOfY = 0;
  if( typeof( window.pageYOffset ) == 'number' ) {
    //Netscape compliant
    scrOfY = window.pageYOffset;
    scrOfX = window.pageXOffset;
  } else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) {
    //DOM compliant
    scrOfY = document.body.scrollTop;
    scrOfX = document.body.scrollLeft;
  } else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) {
    //IE6 standards compliant mode
    scrOfY = document.documentElement.scrollTop;
    scrOfX = document.documentElement.scrollLeft;
  }
  return [ scrOfX, scrOfY ];
}


function ytube(){
if(document.getElementById('hwi-youtube')){
var vid=document.getElementById('hwi-youtube');
var ytube=document.getElementById('ytube');
ytube.innerHTML=vid.innerHTML;
} else {

setTimeout("ytube()",2000);
}
}

