var current_display = 0 

function display_QV(the_id){

document.getElementById('QV_'+the_id).style.display='block'
}

function hide_QV(the_id){
document.getElementById('QV_'+the_id).style.display='none'
}

function display_product_info(the_id){
the_left  =  document.getElementById('QV_'+the_id).offsetLeft
the_top = document.getElementById('QV_'+the_id).offsetTop

the_top  = the_top - 150
the_left = the_left - 150

document.getElementById('product_preview').style.top=the_top
document.getElementById('product_preview').style.left=the_left
document.getElementById('product_preview').style.display='block'
document.getElementById('dept_gopher').src='http://www.hankypanky.com/product_quick_view.asp?product_id='+the_id

}


function display_swatch3(swatch_id){
the_left  = document.getElementById('cs_loc_'+swatch_id).offsetLeft;
the_left2 = document.getElementById('container').offsetLeft;
var thetop = $("#display_col")
var offset = thetop.offset();
the_top = offset.top

the_top = the_top - 85


the_left = the_left + the_left2 +580
document.getElementById('cs_'+swatch_id).style.left=the_left+'px'
document.getElementById('cs_'+swatch_id).style.top=the_top+'px'
document.getElementById('cs_'+swatch_id).style.display='block'

}


function hide_product_info(){
document.getElementById('product_preview').innerHTML="<div style='margin-top:110px'><img src='images/loader.gif' align='middle'></div>"
document.getElementById('product_preview').style.display='none'
}

function add_to_cart(product_id)
{	
	var thevars='';
	var total_prods;
	var qty;
	var kkm;
	var the_qty='';
	
	total_prods = document.getElementById('total_prods').value

	if(current_display>0){
	
	totalvars   = document.getElementById('total_vars_'+product_id).value
	rolled      = document.getElementById('rt_'+product_id).value
	
		for (kk=0;kk<=current_display;kk++)	{
			
			if (kk==0){
				kkm = ''
			}
			else {
				kkm = '_'+kk
			}
			
		
			qty = document.getElementById('prod_qty_'+product_id+kkm).value
		
			for(i=1; i <= totalvars; i++)
		 		 {  
				  if(i != 1){
		  				 	thevars = thevars + ',' + document.getElementById('v_'+product_id+'_'+i+kkm).value 
							
					
						
					}
					else
					{
							thevars = thevars  + document.getElementById('v_'+product_id+'_'+i+kkm).value 
					
					}
					
					
		        }
				
				the_qty = the_qty+qty+"||"
				thevars = thevars+"||"
				
		 } 
	
	
		document.getElementById("AddProd").src="http://www.hankypanky.com/addtocartMultiple.asp?product_id="+product_id+'&vars='+thevars+'&qty='+the_qty+'&rolled='+rolled
	}
	else
	{		
			qty         = document.getElementById('prod_qty_'+product_id).value
			totalvars   = document.getElementById('total_vars_'+product_id).value
			rolled      = document.getElementById('rt_'+product_id).value
					
	
				for(i=1; i <= totalvars; i++)
		 		 {   if(i != 1){
		  				thevars = thevars + ',' + document.getElementById('v_'+product_id+'_'+i).value 
					}
					else
					{
							thevars = thevars  + document.getElementById('v_'+product_id+'_'+i).value 
					}
		   }
			
		   document.getElementById("AddProd").src="http://www.hankypanky.com/addtocart.asp?product_id="+product_id+'&vars='+thevars+'&qty='+qty+'&rolled='+rolled

	
		
	the_left = 0 
	the_left2 = document.getElementById('container').offsetLeft;
	
	the_left2 = the_left2 + 680
	
		
	the_top = getPageScroll();
	

	document.getElementById('cart_contents').style.left = the_left2+'px' 
	document.getElementById('cart_contents').style.top = the_top+'px' 

	document.getElementById('cart_contents').style.left = the_left2+'px' 
	
	slidedown2('cart_contents')	

 //	window.scroll(0,0);

	setTimeout("slideup('cart_contents')",4000)
 						

	
	}
	
	

 
}



function getPageScroll() {
    var xScroll, yScroll;
    if (self.pageYOffset) {
      yScroll = self.pageYOffset;
      xScroll = self.pageXOffset;
    } else if (document.documentElement && document.documentElement.scrollTop) {
      yScroll = document.documentElement.scrollTop;
      xScroll = document.documentElement.scrollLeft;
    } else if (document.body) {// all other Explorers
      yScroll = document.body.scrollTop;
      xScroll = document.body.scrollLeft;
    }
    return  yScroll
}



function add_to_cart2(product_id,vars,qty,rolled)
{	
the_left = 0 
	the_left2 = document.getElementById('container').offsetLeft;
	
	the_left2 = the_left2 + 680

	document.getElementById('cart_contents').style.left = the_left2+'px' 
	


	document.getElementById("AddProd").src="http://www.hankypanky.com/addtocart.asp?product_id="+product_id+'&vars='+vars+'&qty='+qty+'&rolled='+rolled
	slidedown2('cart_contents')	
	
	 	window.scroll(0,0);

	setTimeout("slideup('cart_contents')",4000)
}


function clear_field(the_text,the_element){

	if (document.getElementById(the_element).value==the_text)
		{
			document.getElementById(the_element).value=''
		}
}

function add_field(the_text,the_element){

	if (document.getElementById(the_element).value=='')
		{
			document.getElementById(the_element).value=the_text
		}
}



function zoom(factor) {
	var emap=floater.document.getElementById('the_image');
	
	
	
	var mapHeight = emap.height
	var mapWidth = emap.width
	
	var slope = mapHeight/mapWidth
	
	var newWidth = mapWidth + factor
	var newHeight=mapHeight+(factor*slope)
	
	var diffHeight =  newHeight - mapHeight
	
	
	
	//if ((emap.offsetTop+Math.floor(diffHeight/2))<300){
	emap.style.top=Math.round(emap.offsetTop-(diffHeight/2))+'px'
	//}
	//if ((emap.offsetLeft+Math.floor(diffWidth/2))<500){
	emap.style.left=Math.round(emap.offsetLeft-(factor/2))+'px'
	//}
	//document.getElementById('the_results').innerHTML = document.getElementById('the_results').innerHTML + '<br>' + Math.round(emap.offsetTop-(diffHeight/2))+'px' + '|' + Math.round(emap.offsetLeft-(factor/2))+'px'
	//document.getElementById('the_results2').innerHTML = document.getElementById('the_results2').innerHTML + '<br>' + Math.round(newWidth)+'px' + '|' + Math.round(newHeight)+'px'
	emap.style.width=Math.round(newWidth)+'px';
	emap.style.height=Math.round(newHeight)+'px';
}


function zoomin(fact,i,x,num_frames){
	var msg;
	var x ;
	var the_timeout = 1;
	
	
	if (x<num_frames) {
		if(x==1){
			
			
			if(((document.getElementById('zoom_level').value)>0)&&((document.getElementById('zoom_level').value)<4)){
				document.getElementById('zoom_level').value = parseInt(document.getElementById('zoom_level').value)+i
				}
			if(document.getElementById('zoom_level').value==4 && i==-1){
				document.getElementById('zoom_level').value = 3
			
			}
			if(document.getElementById('zoom_level').value==0 && i==1){
				document.getElementById('zoom_level').value = 2
			
			}
			
			
		
		
		}
		if(((document.getElementById('zoom_level').value)>0)&&((document.getElementById('zoom_level').value)<4)){
		
		if((document.getElementById('zoom_level').value)>3||(document.getElementById('zoom_level').value)>2&&fact<0){ 
			zoom(fact*3);
			num_frames = 15
			the_timeout = 1
		}
		else{
			zoom(fact);
		}
		//zoom(fact);
		}
		
		x+=1
		setTimeout('zoomin('+fact+','+i+','+x+','+num_frames+');',the_timeout)
		}
}


function zoomout(fact,i){

	var msg;
	if (i>fact) {
		zoom(i);
		i=i-.001
		setTimeout('zoomout('+fact+','+i+');',30)
		}
}



function display_image(the_image){
document.getElementById('the_prod').src='gallery_huge/'+the_image
document.getElementById('pop_up').style.display="block"
}


function submit_shipping_change(){
document.getElementById('update_shipping').value='1'
document.purchase_order_form.submit()
}


function display_account_info(the_action,the_plus){

	if(document.getElementById(the_action).style.display=='none')
	{
		slideup('account_info')
		slideup('order_info')
	//	slideup('wish_info')
		
		document.getElementById('pm_ai').innerHTML='+'
		document.getElementById('pm_oi').innerHTML='+'
	//	document.getElementById('pm_wi').innerHTML='+'
		
		slidedown3(the_action)
		
		document.getElementById(the_plus).innerHTML='-'
	}
	else{
		slideup(the_action)
		document.getElementById(the_plus).innerHTML='+'
	}

}


function display_account_info2(the_action,the_plus){

	if(document.getElementById(the_action).style.display=='none')
	{
		slideup('billing_info')
		slideup('shipping_info')
		slideup('login_information')
		slideup('order_info')
		
		document.getElementById('pm_bi').innerHTML='+'
		document.getElementById('pm_si').innerHTML='+'
		document.getElementById('pm_li').innerHTML='+'
		document.getElementById('pm_oi').innerHTML='+'
	//	document.getElementById('pm_wi').innerHTML='+'
		
		slidedown3(the_action)
		
		document.getElementById(the_plus).innerHTML='-'
	}
	else{
		slideup(the_action)
		document.getElementById(the_plus).innerHTML='+'
	}

}



function close_size(){
document.getElementById('size_chart').style.display='none';
}

function display_size_chart(){
document.getElementById('size_chart').style.display='block';
}

function email_close(){
document.getElementById('email_friends').style.display='none';
}

function email_open(product_id){
document.getElementById('email_friends').style.display='block';
document.getElementById('email_friend').src='email_friend.asp?product='+product_id
}



function add_to_wish(product_id)
{	
	var thevars='';
	qty       = document.getElementById('prod_qty_'+product_id).value
	totalvars = document.getElementById('total_vars_'+product_id).value
	rolled    = document.getElementById('rt_'+product_id).value

	
		for(i=1; i <= totalvars; i++)
		  {   if(i != 1){
		  			thevars = thevars + ',' + document.getElementById('v_'+product_id+'_'+i).value 
				}
				else
				{
						thevars = thevars  + document.getElementById('v_'+product_id+'_'+i).value 
				}
		   }
	
	document.getElementById("AddProd").src="http://www.hankypanky.com/addtowish.asp?product_id="+product_id+'&vars='+thevars+'&qty='+qty+'&rolled='+rolled
	
	
	the_left = 0 
	the_left2 = document.getElementById('container').offsetLeft;
	
	the_left2 = the_left2 + 680

	document.getElementById('cart_contents').style.left = the_left2+'px' 
	window.scroll(0,0);
	
	setTimeout("slidedown2('cart_contents')",250)	
	
	
}

function update_personalize(product_id){

	item_1 = document.getElementById('cp_1').value;	
	item_2 = document.getElementById('cp_2').value;
	item_3 = document.getElementById('cp_3').value;
	item_4 = document.getElementById('cp_4').value;
	item_5 = document.getElementById('cp_5').value;
	item_6 = document.getElementById('cp_6').value;
	


	prods = item_1+','+item_2+','+item_3+','+item_4+','+item_5+','+item_6

document.getElementById("personalize_product").src="http://www.hankypanky.com/addtopersonalize.asp?product_id="+product_id+"&prods="+prods
	

}

function switch_rolled(product_id)
{
document.location.href='product_detail.asp?product_id='+product_id

}


function populate_color(close_window)
{
if(close_window==1){
document.getElementById('color_swatcher').src='http://www.hankypanky.com/generate_colors.asp?view_all=0'
}
else
{document.getElementById('color_swatcher').src='http://www.hankypanky.com/generate_colors.asp?view_all=1'
}

}



function display_swatch(swatch_id){
the_left  = document.getElementById('cs_loc_'+swatch_id).offsetLeft;
the_left2 = document.getElementById('container').offsetLeft;



the_left = the_left + the_left2 +207
document.getElementById('cs_'+swatch_id).style.left=the_left+'px'
document.getElementById('cs_'+swatch_id).style.display='block'

}


function display_swatch2(swatch_id){
the_left  = document.getElementById('cs_loc_'+swatch_id).offsetLeft;
the_left2 = document.getElementById('container').offsetLeft;
var thetop = $("#display_col")
var offset = thetop.offset();
the_top = offset.top

the_top = the_top - 85

the_left = the_left + the_left2 +500
document.getElementById('cs_'+swatch_id).style.left=the_left+'px'
document.getElementById('cs_'+swatch_id).style.top=the_top+'px'
document.getElementById('cs_'+swatch_id).style.display='block'

}

function hide_swatch(swatch_id){
document.getElementById('cs_'+swatch_id).style.display='none'
}



function arrow_left()
  {
    if (document.getElementById('thumbnails_container').scrollLeft>0) {
  	document.getElementById('thumbnails_container').scrollLeft = document.getElementById('thumbnails_container').scrollLeft - 75
	}
	//else
	//document.getElementById('thumbnails_container').scrollLeft = document.getElementById('thumbnails_container').scrollWidth
  }
  
  
  
function arrow_right()
  {

  if(document.getElementById('thumbnails_container').scrollWidth-document.getElementById('thumbnails_container').scrollLeft == 300)
	{//document.getElementById('thumbnails_container').scrollLeft=0
	} 
	else
	document.getElementById('thumbnails_container').scrollLeft = document.getElementById('thumbnails_container').scrollLeft + 75
  }
  
  
  
function display_press(image_name,press_id){
close_video()
document.getElementById('press_image').innerHTML="<img src='http://images.hankypanky.com/gallery_press/"+image_name+"' height='700'>"
document.getElementById('press_gallery').style.display="block"
document.getElementById('press_gallery').style.top=document.getElementById('press_'+press_id).offsetTop+20
}

function close_press(image_name){
document.getElementById('press_image').innerHTML=""
document.getElementById('press_gallery').style.display="none"
}

function update_color(product_id,color_id){
//document.getElementById('AddProd').src="image_color_updater.asp?product_id="+product_id+"&color_id="+color_id
document.getElementById('AddProd').contentWindow.location.replace("image_color_updater.asp?product_id="+product_id+"&color_id="+color_id)
}

function update_variant(product_id,update_variant){
document.getElementById('v_'+product_id+'_1').value=update_variant
}

function update_color2(product_id,color_id){
document.getElementById('update_image').contentWindow.location.replace("image_color_updater2.asp?product_id="+product_id+"&color_id="+color_id)
//document.getElementById('update_image').src="image_color_updater2.asp?product_id="+product_id+"&color_id="+color_id
}

function update_swatch(product_id,variant_id){
the_value = document.getElementById(variant_id).value
document.getElementById('update_image').contentWindow.location.replace("image_color_updater.asp?product_id="+product_id+"&variant_id="+the_value)
//document.getElementById('update_image').src="image_color_updater.asp?product_id="+product_id+"&variant_id="+the_value
}

function update_swatch2(product_id,variant_id){
the_value = document.getElementById(variant_id).value
document.getElementById('update_image').contentWindow.location.replace("image_color_updater2.asp?product_id="+product_id+"&variant_id="+the_value)
}


function slide_down_up_style(rec_id)
{

 if(document.getElementById('pm_'+rec_id).innerHTML=='+')
  {	
	document.getElementById('pm_'+rec_id).innerHTML='-'
	slidedown99('display_more_'+rec_id);
  }
 else
 {
	document.getElementById('pm_'+rec_id).innerHTML='+';
	slideup('display_more_'+rec_id);
 }



}

function SelectAll(id)
{
    document.getElementById(id).focus();
    document.getElementById(id).select();
}


/**************************************************************************************
The below functions fix the onmouseover and onmouseout events.
For ex: if I have a main div container then I mouse between elements in
that div such as <li>'s or a table, etc then the onmouseout event and onmouseover
events are triggering.
onmouseenter and onmouseleave is a MS solution in IE 5.5+ but that does us no good
since won't work in FF

so....use functions below as follows
<div 
onmouseover="if (checkMouseEnter(this, event)) {over();}" 
onmouseout="if (checkMouseLeave(this, event)) {out();}"
style="top:100px">

***************************************************************************************/

function containsDOM (container, containee) {
  var isParent = false;
  do {
    if ((isParent = container == containee))
      break;
    containee = containee.parentNode;
  }
  while (containee != null);
  return isParent;
}

function checkMouseEnter (element, evt) {
  if (element.contains && evt.fromElement) {
    return !element.contains(evt.fromElement);
  }
  else if (evt.relatedTarget) {
    return !containsDOM(element, evt.relatedTarget);
  }
}

function checkMouseLeave (element, evt) {
  if (element.contains && evt.toElement) {
    return !element.contains(evt.toElement);
  }
  else if (evt.relatedTarget) {
    return !containsDOM(element, evt.relatedTarget);
  }
}


nav_home1 		  		= new Image();
nav_home1.src 	 		= "https://www.hankypanky.com/images/hanky-panky-top.gif";
nav_home2 		  		= new Image();
nav_home2.src 	 		= "https://www.hankypanky.com/images/hanky-panky-middle.gif";
nav_home3 		  		= new Image();
nav_home3.src 	 		= "https://www.hankypanky.com/images/hanky-panky-bottom.gif";


nav_home_over 	 		= new Image();
nav_home_over.src 	 	= "https://www.hankypanky.com/images/hanky-panky-top-over.gif";
nav_home_over2 	 		= new Image();
nav_home_over2.src 	 	= "https://www.hankypanky.com/images/hanky-panky-middle-over.gif";
nav_home_over3 		  	= new Image();
nav_home_over3.src 	 	= "https://www.hankypanky.com/images/hanky-panky-bottom-over.gif";


function swapImage(on_off) {

if(on_off==1){
document.nav_home1.src = nav_home_over.src
document.nav_home2.src = nav_home_over2.src
document.nav_home3.src = nav_home_over3.src
}
else
{
document.nav_home1.src = nav_home1.src
document.nav_home2.src = nav_home2.src
document.nav_home3.src = nav_home3.src
}
}

function display_bio(the_id)
{
document.getElementById('content_100017').style.display="none"
document.getElementById('content_100018').style.display="none"
document.getElementById('content_100019').style.display="none"

document.getElementById('img_100017').style.filter="alpha(opacity=50)"
document.getElementById('img_100017').style.opacity=".50"

document.getElementById('img_100018').style.filter="alpha(opacity=50)"
document.getElementById('img_100018').style.opacity=".50"

document.getElementById('img_100019').style.filter="alpha(opacity=50)"
document.getElementById('img_100019').style.opacity=".50"



document.getElementById('content_'+the_id).style.display="block"
document.getElementById('img_'+the_id).style.filter="alpha(opacity=100)"
document.getElementById('img_'+the_id).style.opacity="1"
}



function display_bio2(the_id)
{
document.getElementById('content_100027').style.display="none"
document.getElementById('content_100028').style.display="none"
document.getElementById('content_100029').style.display="none"
document.getElementById('content_100030').style.display="none"

document.getElementById('img_100027').style.filter="alpha(opacity=50)"
document.getElementById('img_100027').style.opacity=".50"

document.getElementById('img_100028').style.filter="alpha(opacity=50)"
document.getElementById('img_100028').style.opacity=".50"

document.getElementById('img_100029').style.filter="alpha(opacity=50)"
document.getElementById('img_100029').style.opacity=".50"

document.getElementById('img_100030').style.filter="alpha(opacity=50)"
document.getElementById('img_100030').style.opacity=".50"


document.getElementById('content_'+the_id).style.display="block"
document.getElementById('img_'+the_id).style.filter="alpha(opacity=100)"
document.getElementById('img_'+the_id).style.opacity="1"
}


function submit_form()
{
document.getElementById('placeorder').disabled=true;
document.getElementById('final_submit').value='1';

}



function display_video(press_id){
close_press()
document.getElementById('press_gopher').src="http://www.hankypanky.com/press_updater.asp?rec_id="+press_id
document.getElementById('press_video').style.display="block"
document.getElementById('press_video').style.top=document.getElementById('press_'+press_id).offsetTop+200

}


function close_video(){
document.getElementById('press_video_canvas').innerHTML=""
document.getElementById('press_video').style.display="none"
}


function update_size_var(product_id){
//GET COLOR ID
the_color 	  = document.getElementById('v_'+product_id+'_1').value
selected_size = document.getElementById('v_'+product_id+'_2').value
total_sizes   = document.getElementById('total_sizes_'+product_id).value

//document.getElementById('AddProd').src="update_size_vars.asp?total_sizes="+total_sizes+"&product_id="+product_id+"&color_id="+the_color+"&selected_size="+selected_size
document.getElementById('AddProd').contentWindow.location.replace("update_size_vars.asp?total_sizes="+total_sizes+"&product_id="+product_id+"&color_id="+the_color+"&selected_size="+selected_size)
}

function update_color_var(product_id){
//GET COLOR ID
selected_color  = document.getElementById('v_'+product_id+'_1').value
the_size	    = document.getElementById('v_'+product_id+'_2').value
total_colors    = document.getElementById('total_colors_'+product_id).value

//document.getElementById('AddProd').src="update_color_vars.asp?total_colors="+total_colors+"&product_id="+product_id+"&size_id="+the_size+"&selected_color="+selected_color
document.getElementById('AddProd').contentWindow.location.replace("update_color_vars.asp?total_colors="+total_colors+"&product_id="+product_id+"&size_id="+the_size+"&selected_color="+selected_color)
}




function PC_direct()
{

if(document.getElementById('id_direct_link').style.display=='block'){
	document.getElementById('id_direct_link').style.display='none'}
else
{
	document.getElementById('id_direct_link').style.display='block'}
}

function display_more()
{
	current_display = (current_display == 6) ? 1 : current_display + 1;
	
	if(current_display>4){
	 	document.getElementById('add_more_text').style.display="none"
	}
	
	
	document.getElementById('more_options_'+current_display).style.display="block"
	document.getElementById('close_options').style.display="block"

//alert(current_display)
}



function hide_more()
{
	document.getElementById('more_options_'+current_display).style.display="none"
	current_display =  current_display - 1;
	
	if(current_display==0)
	{
			document.getElementById('close_options').style.display="none"
	}
//alert(current_display)
}



function letus_open(product_id){

document.getElementById('preview_product').style.display='block';
document.getElementById('preview_products').src='preview_request.asp?product='+product_id
}



function update_tax_info(){
document.getElementById('ship_zip').value=document.getElementById('returned_zip').value

if(document.getElementById('entered_zip')){
document.getElementById('entered_zip').innerHTML=document.getElementById('returned_zip').value
}


document.getElementById('ship_state').value=document.getElementById('returned_state').value

if(document.getElementById('entered_state')){
document.getElementById('entered_state').innerHTML=document.getElementById('returned_state').value
}
	
document.getElementById('ship_city').value=document.getElementById('returned_city').value

if(document.getElementById('entered_city')){
document.getElementById('entered_city').innerHTML=document.getElementById('returned_city').value
}
}

function update_color_var3(rec_id, product_id){
//GET COLOR ID


selected_color  = document.getElementById('v_'+rec_id+'_1').value
the_size	    = document.getElementById('v_'+rec_id+'_2').value
total_colors    = document.getElementById('total_colors_'+rec_id).value

//document.getElementById('AddProd').src="update_color_vars.asp?total_colors="+total_colors+"&product_id="+product_id+"&size_id="+the_size+"&selected_color="+selected_color
document.getElementById('AddProd').contentWindow.location.replace("update_color_vars3.asp?the_rec_id="+rec_id+"&total_colors="+total_colors+"&product_id="+product_id+"&size_id="+the_size+"&selected_color="+selected_color)
}


function update_size_var3(rec_id, product_id){
//GET COLOR ID

the_color 	  = document.getElementById('v_'+rec_id+'_1').value
selected_size = document.getElementById('v_'+rec_id+'_2').value
total_sizes   = document.getElementById('total_sizes_'+rec_id).value

//document.getElementById('AddProd').src="update_size_vars.asp?total_sizes="+total_sizes+"&product_id="+product_id+"&color_id="+the_color+"&selected_size="+selected_size
document.getElementById('AddProd').contentWindow.location.replace("update_size_vars3.asp?the_rec_id="+rec_id+"&total_sizes="+total_sizes+"&product_id="+product_id+"&color_id="+the_color+"&selected_size="+selected_size)
}


function tl(the_link){
document.getElementById('TrackClick').contentWindow.location.replace("track_link.asp?prov="+the_link)
}





function display_slide(rec_id,title)
{

if(selected_slide==0){
  jQuery(jQuery('.slide_show_holder')).css('opacity', '0');
}




 jQuery(jQuery('.titles')).css('display', 'none');

 jQuery('#title_'+rec_id).css('display', 'block');
 
 jQuery('.slide_show_holder').css('z-index', '-1');
 jQuery('.slide_show_holder').css('display','block');
 jQuery(jQuery('.slide_show_holder')[selected_slide]).css('z-index', '100');
 jQuery(jQuery('.slide_show_holder')[rec_id]).css('z-index', '101');

 //jQuery(jQuery('.slide_show_holder')[selected_slide]).css('display', 'none');
 jQuery(jQuery('.slide_show_holder')[selected_slide]).animate({opacity: 0.0}, 900);

 jQuery(jQuery('.slide_show_holder')[rec_id]).animate({opacity: 1.0}, 1000);

$('#slide_holder td div').html("<div class='home_thumbs'></div>")	

the_img = rec_id+1
the_over_img = the_img+"_over.gif" 

document.getElementById("dt_"+rec_id).innerHTML = "<div class='home_thumbs'><img src='images/home_banners/thumb/"+the_over_img+"' border='0'></div>"
//$('#banner_title').html(title)	
 
selected_slide = rec_id
clearInterval(startShow)
startShow = setInterval("RotateSlide()",7000)

}


function slideupfunc() {

if(document.getElementById('float_email_signup')){

 window.onscroll = function () 
	 		{
                slideup = document.getElementById('float_email_signup');        
				var footerHeight = slideup.offsetHeight;    
				var windowHeight = window.innerHeight?  window.innerHeight :  document.body.clientHeight;       
				var pageOffSet = document.body.scrollTop  
				slideup.style.top = ( pageOffSet +  windowHeight - 106) + "px";
            }

	var slideup;
	
	var broswerType=navigator.appVersion
	slideup = document.getElementById('float_email_signup');
	
	if (broswerType.indexOf('MSIE') > 1 ) {
	
	//	slideup.filters[0].Apply();
		
		if (slideup.style.visibility == "visible") { 
			slideup.style.visibility = "hidden"; 
			//slideup.filters.revealTrans.transition=4; 
		} else { 
			//getData("showSubscribe.asp?showSub=1","slideup");
			slideup.style.visibility = "visible";  
		//	slideup.filters[0].transition=4; 
			
			
		} 
			
	//	slideup.filters[0].Play(); 
		
	} else {
		
		if (slideup.style.visibility == "visible") { 
			slideup.style.visibility = "hidden"; 
		} else { 
			slideup.style.visibility = "visible"; 
		} 
	}	
	}
}


function update_noPP(){

if(document.getElementById("no_notify").checked ==true){
checked_off = '1'
}
else
{
checked_off = '0'
}

document.getElementById('update_no').contentWindow.location.replace("update_no.asp?do_not="+checked_off)

document.getElementById('panky_banner').style.display='none'
}





function expand_nav(the_obj,dept_id,level,current_dept){



if(document.getElementById(the_obj).style.display=='block'){
$.ajax({
  type: 'POST',
  async: false, 
  url: 'http://www.hankypanky.com/getdeptListing.asp?dept_id='+dept_id+'&close=1',
  	success: function(data) {
  }
});	
	
$('#'+the_obj).css("display","none");	

}
else{


if(	level != 2){
$(".x_div").css("display","none");	
}
	
$.ajax({
	     type: 'POST',
 async: false, 
  url: 'http://www.hankypanky.com/getdeptListing.asp?dept_id='+dept_id+'&level='+level+'&CD='+current_dept,
  success: function(data) {
    $('#'+the_obj).html(data);
   	$('#'+the_obj).css("display","block");
  }
});	

}
	
}



function display_tab(product_id,the_tab){
var tab 

if(the_tab==1){
tab='tab_details'
div = 'div_details'
}

if(the_tab==2){
tab='tab_size'
div = 'div_size'

$.ajax({
  type: 'POST',
  async: false, 
  url: 'getSizeInfo.asp?product_id='+product_id,
  	success: function(data) {
		   $('#div_size').html(data);
  }
});	


}


if(the_tab==3){
tab='tab_shipping'
div = 'div_shipping'
}

if(the_tab==4){
tab='tab_as_seen'
div = 'div_as_seen'
}

if(the_tab==5){
tab='tab_fabric'
div = 'div_fabric'
}

if(document.getElementById('tab_details')){
document.getElementById('tab_details').className='pd_tab_off'
document.getElementById('div_details').style.display="none"
}

if(document.getElementById('tab_size')){
document.getElementById('tab_size').className='pd_tab_off'
document.getElementById('div_size').style.display="none"
}



if(document.getElementById('tab_shipping')){
document.getElementById('tab_shipping').className='pd_tab_off'
document.getElementById('div_shipping').style.display="none"

}

if(document.getElementById('tab_as_seen')){
document.getElementById('tab_as_seen').className='pd_tab_off'
document.getElementById('div_as_seen').style.display="none"

}

if(document.getElementById('tab_fabric')){
document.getElementById('tab_fabric').className='pd_tab_off'
document.getElementById('div_fabric').style.display="none"

}


document.getElementById(tab).className='pd_tab_on'
document.getElementById(div).style.display="block"


}

