function QBox(action, src, mov_width, mov_height, id) {
	
	if(BrowserDetect.browser == "Safari") {
	    
	    height = (Number(mov_height) + 50);
	    width = (Number(mov_width) + 50);
	    newwindow=window.open(src,'movie','height='+height+',width='+width);
	    if (window.focus) {newwindow.focus()}
	    return false;
	    //window.location.href = src;
	    
	}else{
	
	    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;
	    }
    	
    	
	    var yScroll;

	    if (self.pageYOffset) {
		    yScroll = self.pageYOffset;
	    } else if (document.documentElement && document.documentElement.scrollTop){	 // Explorer 6 Strict
		    yScroll = document.documentElement.scrollTop;
	    } else if (document.body) {// all other Explorers
		    yScroll = document.body.scrollTop;
	    }
    	
    	

	    //var scr_h = screen.availHeight;
	    var qbox_cont = document.getElementById("qbox_cont");
	    var qbox_struct = document.getElementById("qbox_struct");
    var qbox_struct_Inner = document.getElementById("qbox_struct_Inner");

	    qbox_cont.style.display = "block";
	    qbox_cont.style.width = "100%";
	    qbox_cont.style.height = pageHeight + 'px';
    	
	    mov_width = Number(mov_width);
	    mov_height = (Number(mov_height) + 16);
    	
	    //popup_form.style.marginTop = pageHeight / 4 + 'px';
    	
    	
    	
	    qbox_struct.style.display = "block";
	    qbox_struct.style.top = (yScroll + ((windowHeight - 35 - mov_height) / 2) + 'px');
	    qbox_struct.style.left = (((pageWidth - 20 - mov_width) / 2) + 'px');
	    qbox_struct_Inner.innerHTML = '<object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" codebase="http://www.apple.com/qtactivex/qtplugin.cab" width="'+mov_width+'" height="'+mov_height+'"><param name="src" value="'+src+'" /><param name="autoplay" value="true" /><param name="controller" value="true" /><embed src="'+src+'" width="'+mov_width+'" height="'+mov_height+'" autoplay="true" type="video/quicktime" controller="true" pluginspage="http://www.apple.com/quicktime/download/"></object>';
    	
    	
	    //document.qboxquick.SetURL(src);
	    //document.qboxquick.src = src;
	    //document.qboxquick.height = mov_height;
	    //document.qboxquick.width = mov_width;
	    //document.qboxquick.Play();
	    //var a = document.createElement('span');
	    //var mychild = document.createTextNode('<object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" codebase="http://www.apple.com/qtactivex/qtplugin.cab" width="'+mov_width+'" height="'+mov_height+'"><param name="src" value="'+src+'" /><param name="autoplay" value="true" /><param name="controller" value="true" /><embed src="'+src+'" width="'+mov_width+'" height="'+mov_height+'" autoplay="true" type="video/quicktime" controller="true" pluginspage="http://www.apple.com/quicktime/download/"></object>');
	    //var mychild2 = '<div style="background:#f00; width: 300px; height: 200px;">'+mychild+'</div>';
	    //a.innerHTML = mychild.text;


	    document.getElementById("close_btn").onclick = function() { QBox('close', '', '', '', id); }
    	
	    selects = document.getElementsByTagName("select");
	    for (i = 0; i < selects.length; i++) {
		    selects[i].style.visibility = "hidden";
	    }
    	
    	
	    if(action == 'close') {
		    for (i = 0; i < selects.length; i++) {
			    selects[i].style.visibility = "visible";
		    }
		    qbox_cont.style.display = "none";
		    qbox_struct.style.display = "none";
		    if(id) 
		        window.location="?mid="+id;
		    else
		        window.location="?";
	    }	
	    if(action == 'close2') {
		    for (i = 0; i < selects.length; i++) {
			    selects[i].style.visibility = "visible";
		    }
		    qbox_cont.style.display = "none";
		    qbox_struct.style.display = "none";
		    window.location= src ;
	    }	
	}
}


    function QBox_Port(action, src) {

	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;
	}
	
	
	var yScroll;

	if (self.pageYOffset) {
		yScroll = self.pageYOffset;
	} else if (document.documentElement && document.documentElement.scrollTop){	 // Explorer 6 Strict
		yScroll = document.documentElement.scrollTop;
	} else if (document.body) {// all other Explorers
		yScroll = document.body.scrollTop;
	}
	InteractiveAssetsLG();
//	image_url = new Array();
//  image_url[0] = "/images/interactive_ss/source_get_fresh.jpg";
//  image_url[1] = "/images/interactive_ss/source_ceili_rain.jpg";
//  image_url[2] = "/images/interactive_ss/source_cottonelle_grab_game.jpg";
//  image_url[3] = "/images/interactive_ss/source_outsider.jpg";
//  image_url[4] = "/images/interactive_ss/source_prestige.jpg";
//  image_url[5] = "/images/interactive_ss/source_ki_seeitspecit.jpg";
//  image_url[6] = "/images/interactive_ss/source_screenmag.jpg";
//  image_url[7] = "/images/interactive_ss/source_jotogo.jpg";
//  image_url[8] = "/images/interactive_ss/source_osmiami.jpg";
//  image_url[9] = "/images/interactive_ss/source_lsb.jpg";
//  image_url[10] = "/images/interactive_ss/source_wct.jpg";
//  image_url[11] = "/images/interactive_ss/source_arclakeland.jpg";

//  url = new Array();
//  url[0] = "http://www.getfreshfruit.com";
//  url[1] = "http://www.ceilirain.com";
//  url[2] = "http://www.balancestudios.com/balancebeam/showcase/cottonelle_popgame.htm";
//  url[3] = "http://www.outsiderinc.com";
//  url[4] = "http://www.prestigeparktowers.com";
//  url[5] = "http://www.kihealthcare.com/gallery_view.aspx?glid=113";
//  url[6] = "http://www.screenmag.tv";
//  url[7] = "http://www.jotogo.com";
//  url[8] = "http://www.osmiami.com";
//  url[9] = "http://www.lsb.com/";
//  url[10] = "http://www.wisconsinconnectiontours.com";
//  url[11] = "http://www.arclakeland.org";

	var qbox_cont = document.getElementById("qbox_cont");
	var qbox_struct = document.getElementById("qbox_struct");
    var qbox_struct_Inner = document.getElementById("qbox_struct_Inner");
    var i = 0;
    var med_container = document.getElementById("med_cont");
    var link = document.getElementById("launch_link");
    var enlarge = document.getElementById("enlarge_link");
    var med_container_src = med_container.src.slice(31, med_container.src.length);
    var close_btn = document.getElementById("close_btn");
    
    close_btn.onclick = function() { QBox_Port('close', '', '', ''); }
    
   
	qbox_struct_Inner.innerHTML = '<img id="med_cont_LG" class="pod_img_LG" src="'+image_url[Number(src)]+'" />';
	qbox_struct_Inner.innerHTML += '<br /><a href="#" onclick="interactiveSlideshow_LG(\'prev\'); return false;"><img class="pod_prev_LG" src="/images/ico_pod_prev.jpg" alt="prev" /></a>';
	qbox_struct_Inner.innerHTML += '<a href="#" onclick="interactiveSlideshow_LG(\'next\'); return false;" style="margin-right: 393px;"><img class="pod_next_LG" src="/images/ico_pod_next.jpg" alt="next" /></a>';
	qbox_struct_Inner.innerHTML += '<a href="'+url[Number(src)]+'" id="launch_link_LG" target="_blank" title="Launch Website"><img class="launch_link" src="/images/ico_launch.jpg" alt="LAUNCH" /></a>';
	qbox_struct_Inner.innerHTML += '<a href="#" onclick="QBox_Port(\'close\', \'\', \'\', \'\');" title="Close"><img class="close_link"  src="/images/ico_close.jpg" alt="CLOSE" /></a>';

	qbox_cont.style.display = "block";
	qbox_cont.style.width = "100%";
	qbox_cont.style.height = pageHeight + 'px';
	

	qbox_struct.style.display = "block";
	qbox_struct.style.top = (yScroll + ((windowHeight - 35 - 600) / 2) + 'px');
	qbox_struct.style.left = (((pageWidth - 20 - 600) / 2) + 'px');
	qbox_struct.style.padding = "25px";
	
	selects = document.getElementsByTagName("select");
	for (i = 0; i < selects.length; i++) {
		selects[i].style.visibility = "hidden";
	}
	
	
	if(action == 'close') {
		for (i = 0; i < selects.length; i++) {
			selects[i].style.visibility = "visible";
		}
		qbox_cont.style.display = "none";
		qbox_struct.style.display = "none";
	}		
}





function QBox_PhotoGallery(action, src, gallery) {

	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;
	}
	
	
	var yScroll;

	if (self.pageYOffset) {
		yScroll = self.pageYOffset;
	} else if (document.documentElement && document.documentElement.scrollTop){	 // Explorer 6 Strict
		yScroll = document.documentElement.scrollTop;
	} else if (document.body) {// all other Explorers
		yScroll = document.body.scrollTop;
	}
    
    GalleryAssets(gallery);
 
	var qbox_cont = document.getElementById("qbox_cont");
	var qbox_struct = document.getElementById("qbox_struct");
    var qbox_struct_Inner = document.getElementById("qbox_struct_Inner");
    
    var i = 0;
    var close_btn = document.getElementById("close_btn");
    close_btn.onclick = function() { QBox_PhotoGallery('close', '', ''); }
    
   //alert(image_url[Number(src)]);
	qbox_struct_Inner.innerHTML = '<table cellspacing="0" cellpadding="0"><tr><td style="height: 500px; width: 650px; text-align: center;"><img id="photo_LG" src="'+image_url[Number(src)]+'" /></td></tr></table>';
	qbox_struct_Inner.innerHTML += '<div class="gallery_controls"><div class="left"><a href="#" onclick="PhotoGallery(\'prev\', \''+gallery+'\'); return false;"><img class="pod_prev_LG" src="/images/ico_pod_prev.jpg" alt="prev" /></a><a href="#" onclick="PhotoGallery(\'next\', \''+gallery+'\'); return false;"><img class="pod_next_LG" src="/images/ico_pod_next.jpg" alt="next" /></a></div><div class="caption" id="caption_LG">'+caption[Number(src)]+'</div><div class="right"><a href="#" onclick="QBox_PhotoGallery(\'close\', \'\', \'\');" title="Close"><img class="close_link"  src="/images/ico_close.jpg" alt="CLOSE" /></a></div>';

	qbox_cont.style.display = "block";
	qbox_cont.style.width = "100%";
	qbox_cont.style.height = pageHeight + 'px';
	

	qbox_struct.style.display = "block";
	qbox_struct.style.top = (yScroll + ((windowHeight - 35 - 600) / 2) + 'px');
	qbox_struct.style.left = (((pageWidth - 20 - 600) / 2) + 'px');
	qbox_struct.style.padding = "25px";
	
	selects = document.getElementsByTagName("select");
	for (i = 0; i < selects.length; i++) {
		selects[i].style.visibility = "hidden";
	}
	
	
	if(action == 'close') {
		for (i = 0; i < selects.length; i++) {
			selects[i].style.visibility = "visible";
		}
		qbox_cont.style.display = "none";
		qbox_struct.style.display = "none";
	}		
}



function QBox_V2(src, width, id) {
    
        var body = document.getElementsByTagName('body')[0];
        var container = document.createElement('div');
        var inner = document.createElement('div');
        var struct = document.createElement('div');
        var close_a = document.createElement('a');
        var image = document.createElement('img');

        body.appendChild(container);
            container.id = "v2_container";
            container.className = "v2_container";
            
        body.appendChild(inner);
            inner.id = "v2_inner";
            inner.className = "v2_inner";
       
        inner.appendChild(struct);          
            struct.className = "v2_struct";           
            struct.style.width = width + "px";
                    
        struct.appendChild(close_a);
            close_a.href = "#";
            close_a.className = "close";
            close_a.innerHTML = '<img src="/images/ico_close_x.gif" alt="[X]" />';
            close_a.onclick = function() { QBox_V2_close(id);return false; }
        
        struct.appendChild(image);
            image.src = src;
            
        //window.location = "#mid="+id+"&amp;show=1";

}

function QBox_V2_close(id) {
    document.getElementById("v2_container").style.display = "none";
    document.getElementById("v2_inner").style.display = "none";
    if(id) 
        window.location="?mid="+id;   
    else
        window.location="?";

     //        window.location = "#mid="+id;
}

function QBox_V3(src, width, id) {
        
        document.getElementsByTagName("body")[0].style.overflow = "hidden"
        var body = document.getElementsByTagName('body')[0];
        var container = document.createElement('div');
        var content_overlay_outer = document.createElement('div');
        
            var content_overlay_tr = document.createElement('tr');
            var content_overlay_td = document.createElement('td');
            
        var content = document.createElement('div');
        var close_a = document.createElement('a');
        var image = document.createElement('img');

        body.appendChild(container);
            container.id = "v3_container";
            container.className = "v3_container";
            
            //container.innerHTML += "";
            //container.innerHTML += "";
           
        body.appendChild(content_overlay_outer);
            content_overlay_outer.id = "v3_content_table_outer";
            content_overlay_outer.innerHTML = "<table id=\"v3_content_table\"><tr><td><div id=\"v3_content\">hi</div></td></tr></table>";
         
         /*   
        content_overlay.appendChild(content_overlay_tr);
        
        content_overlay_tr.appendChild(content_overlay_td);
       
       
        content_overlay_td.appendChild(content);          
            content.className = "v3_content";           
            content.style.width = width + "px";
                    
        struct.appendChild(close_a);
            close_a.href = "#";
            close_a.className = "close";
            close_a.innerHTML = '<img src="/images/ico_close_x.gif" alt="[X]" />';
            close_a.onclick = function() { QBox_V2_close(id);return false; } 
        
        struct.appendChild(image);
            image.src = src; */
            
        //window.location = "#mid="+id+"&amp;show=1";

}


