function swap_to_password(to_hide,to_show,input_focus){

document.getElementById(to_hide).style.display="none"
document.getElementById(to_show).style.display="block"
document.getElementById(input_focus).focus();
}


function swapImage(thisImage,newImage) {

	if (document.images) {
		document[thisImage].src = eval(newImage + ".src")
	}
	
}

function swap_large_image(main_pic){
document.getElementById('floater_image').src='pop.asp?load_image=1&imgname='+main_pic
document.getElementById('the_zoom_image').value=main_pic;
}


function clear_field(the_text,the_element){
if (document.getElementById(the_element).value==the_text)
{
document.getElementById(the_element).value=''
}
}


function display_reply(comment_id){
document.getElementById("reply_"+comment_id).style.display="block"
}




//*************************NAVIGATION*****************************************
//***************************************************************************
nav_home 		  		= new Image();
nav_home.src 	 		= "images/nav_daily_deal.gif";

nav_home_over 	  		= new Image();
nav_home_over.src 		= "images/nav_daily_deal_over.gif";

nav_done_deals 		  		= new Image();
nav_done_deals.src 	 		= "images/nav_done_deals.gif";

nav_done_deals_over 	  		= new Image();
nav_done_deals_over.src 		= "images/nav_done_deals_over.gif";

nav_blog       		   	= new Image();
nav_blog.src            = "images/nav_blog.gif";

nav_blog_over 		    = new Image();
nav_blog_over.src       = "images/nav_blog_over.gif";
  
nav_who_we_are      	= new Image();
nav_who_we_are.src      = "images/nav_who_we_are.gif";

nav_who_we_are_over     = new Image();
nav_who_we_are_over.src = "images/nav_who_we_are_over.gif";

nav_my_account      	= new Image();
nav_my_account.src      = "images/nav_my_account.gif";

nav_my_account_over  	= new Image();
nav_my_account_over.src = "images/nav_my_account_over.gif";

nav_community      		= new Image();
nav_community.src       = "images/nav_community.gif";

nav_community_over  	= new Image();
nav_community_over.src  = "images/nav_community_over.gif";


nav_done_deals          = new Image();
nav_done_deals.src  	= "images/nav_done_deals.gif";


nav_done_deals_over  	= new Image();
nav_done_deals_over.src  = "images/nav_done_deals_over.gif";

blue_arrow  	= new Image();
blue_arrow.src  = "images/blue_arrow.gif";

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)<5)){
				document.getElementById('zoom_level').value = parseInt(document.getElementById('zoom_level').value)+i
				}
			if(document.getElementById('zoom_level').value==5 && 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)<5)){
		
		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 close_div(){
document.getElementById('pop_up').style.display="none"
}

function flip_the_switch(the_id,product_id){
document.getElementById('sd1_1').className='normal'
document.getElementById('sd1_2').className='normal'
document.getElementById('sd1_3').className='normal'

document.getElementById('sd2_1').className='side_deal_gray'
document.getElementById('sd2_2').className='side_deal_gray'
document.getElementById('sd2_3').className='side_deal_gray'


document.getElementById('sd1_'+the_id).className='side_deal_arrow'
document.getElementById('sd2_'+the_id).className='side_deal_blue'


}

function close_side_deals(the_id){
document.getElementById('sd1_1').className='normal'
document.getElementById('sd1_2').className='normal'
document.getElementById('sd1_3').className='normal'

document.getElementById('sd2_1').className='side_deal_gray'
document.getElementById('sd2_2').className='side_deal_gray'
document.getElementById('sd2_3').className='side_deal_gray'
}

function display_product(product_id){
document.getElementById('prod_to_add').value=product_id
document.getElementById('updater').src="side_deal_updater.asp?product_id="+product_id
}


function create_PP(){

document.paypal.submit()

setTimeout("create_order();",1);

}

function create_order()
{
document.getElementById('placeorder').value='placeorder';
document.purchase_order_form2.submit();
}




function add_to_cart(product_id)
{	
	var thevars='';
	if(document.getElementById('add_multi_variant_'+product_id)){
	thevars = document.getElementById('add_multi_variant_'+product_id).value
	}
		
	
	document.getElementById("AddProd").src="http://www.dailycheckout.com/addtocart.asp?product_id="+product_id+'&vars='+thevars+'&qty=1'
	the_left = 0 
	document.getElementById('cart_holder').style.display= 'block' 
	window.scroll(0,0);
	
}


function submit_form()
{
document.getElementById('placeorder').disabled=true;
document.getElementById('final_submit').value='1';
}
