function showcommentcontent(name1)
{
	var divstyle = new String();
        divstyle = document.getElementById(name1).style.display;
        if(divstyle.toLowerCase()=="" || divstyle == "")
        {
            document.getElementById(name1).style.display = "none";
        }
        else
        {
            document.getElementById(name1).style.display = "";
        }
	
}

//popup for login-----------------------------------------------------------
function ModalPopupsCustom1() {
					ModalPopups.Custom("idCustom1",
						"Login to Kirsten Devies",
						"<form action='login.php' name='login' method='post'>"+
						"<div style='padding: 25px;'>" + 
						"<table>" + 
						"<tr><td>User Name</td><td><input type=text id='username' style='width:250px;' name='userName'></td></tr>" + 
						"<tr><td>Password</td><td><input type=password id='passwrd' style='width:250px;' name='password'></td></tr>" + 
						"</table></form>" + 
						"</div>", 
						{
							width: 500,
							buttons: "ok,cancel",
							okButtonText: "Save",
							cancelButtonText: "Cancel",
							onOk: "ModalPopupsCustom1Save()",
							onCancel: "ModalPopupsCustom1Cancel()"
						}
					);
							
					//ModalPopups.GetCustomControl("inputCustom1Name").focus(); 
				}
				
				function ModalPopupsCustom1Save() {
					var custom1Name = ModalPopups.GetCustomControl("username"); 
					if(custom1Name.value == "")
					{
						alert("Please submit a name to this form");
						custom1Name.focus();
					}
					else
					{
						alert("Your name is: " + custom1Name.value);
						
						ModalPopups.Close("idCustom1");
					}
				}
function ModalPopupsCustom1Cancel() {
					//alert('You pressed Cancel');
					ModalPopups.Cancel("idCustom1");
				}
//-----------------------------------------------------------------------------------------------


//---------------------popup for register=========================================================
				function ModalPopupsAlert1() {
					ModalPopups.Custom("iAlert1",
						"Register Kirsten Devies",
						"<form action='register.php' name='register' method='post'>"+
						"<div style='padding: 25px;'>" + 
						"<table>" + 
						"<tr><td>User Name</td><td><input type=text id='username' style='width:250px;' name='username'></td></tr>" + 
						"<tr><td>Password</td><td><input type=password name='password' id='passwd' style='width:250px;'></td></tr>"+
						"<tr><td>First Name</td><td><input type=text id='firstname' style='width:250px;' name='firstname'></td></tr>"+
						"<tr><td>Last Name</td><td><input type=text id='lastname' name='lastname' style='width:250px;'></td></tr>"+
						"<tr><td>Email</td><td><input type=text id='email'  name= 'email' style='width:250px;'></td></tr>" + 
						"</table></form>" + 
						"</div>", 
						{
							width: 500,
							buttons: "ok,cancel",
							okButtonText: "Save",
							cancelButtonText: "Cancel",
							onOk: "ModalPopupsCustom2Save()",
							onCancel: "ModalPopupsCustom2Cancel()"
						}
					);
							
					//ModalPopups.GetCustomControl("inputCustom1Name").focus(); 
				}
					function ModalPopupsCustom2Save() {
					var custom1Name = ModalPopups.GetCustomControl("username"); 
					if(custom1Name.value == "")
					{
						alert("Please submit a name to this form");
						custom1Name.focus();
					}
					else
					{
						alert("Your name is: " + custom1Name.value);
						ModalPopups.Close("iAlert1");
					}
				}
				
				function ModalPopupsCustom2Cancel() {
					//alert('You pressed Cancel');
					ModalPopups.Cancel("iAlert1");
				}
				function ModalPopupsConfirmNo() {
					//alert('You pressed No');
					ModalPopups.Cancel("idCustom2");
				}
//=--------------------------------------------------------------------------------------------------				

	function ModalPopupsAlert2(blogid,replyid) {
					ModalPopups.Custom("iAlert2",
						"Register Kirsten Devies",
						"<form action='postcomment.php' name='post_comment' method='post'>"+
						"<input type='hidden' name='blogid' value='"+blogid+"'>"+
						"<input type='hidden' name='replyid' value='"+replyid+"'>"+
						"<div style='padding: 25px;'>" + 
						"<table>" + 
						"<tr><td>Subject</td><td><input type=text id='Subject' style='width:250px;'></td></tr>" + 
						"<tr><td>Comment</td><td><textarea id='Comment' style='width:250px;'></td></tr>" + 
						"</table>" +
						"</form>"+
						"</div>", 
						{
							width: 500,
							buttons: "ok,cancel",
							okButtonText: "Save",
							cancelButtonText: "Cancel",
							onOk: "ModalPopupsCustom3Save()",
							onCancel: "ModalPopupsCustom3Cancel()"
						}
					);
							
					//ModalPopups.GetCustomControl("inputCustom1Name").focus(); 
				}
					function ModalPopupsCustom3Save() {
					var custom1Name = ModalPopups.GetCustomControl("inputCustom1EMail"); 
					if(custom1Name.value == "")
					{
						alert("Please submit a name to this form");
						custom2Name.focus();
					}
					else
					{
						alert("Your name is: " + custom1Name.value);
						ModalPopups.Close("iAlert2");
					}
				}
				
				function ModalPopupsCustom3Cancel() {
					//alert('You pressed Cancel');
					ModalPopups.Cancel("iAlert2");
				}
				function ModalPopupsConfirmNo() {
					//alert('You pressed No');
					ModalPopups.Cancel("idCustom2");
				}
				
function processCart(mode)
{
	document.frmcart.mode.value = mode;
	document.frmcart.submit();
}


function addtocart(mode,id)
{

	document.frmmerch.mode.value = mode;
	document.frmmerch.id.value = id;
	document.frmmerch.submit();
}


function hideTable(val)
{
	if(val==true)
	{
		document.getElementById('Ship_Address').style.display = "none";
	}
	else
	{
		document.getElementById('Ship_Address').style.display="";
		//document.frmsignup.sh_title.value="";
	}
}

function fillInfo(control,basefield,selectedfield)
{
	control.options.length = 0;
	flag = 0;
	for(i=0,j=0; i<fillArr.length; i++)
	{
		if(fillArr[i][0] == basefield)
		{
			if(selectedfield == fillArr[i][1])
			{
				control.options[j] = new Option(fillArr[i][1]+" "+fillArr[i][2]);
				control.options[j].value = fillArr[i][1];
				control.options[j].selected = true;
				flag = 1;
				
			}
			else
			{
				control.options[j] = new Option(fillArr[i][1]+" "+fillArr[i][2]);
				control.options[j].value = fillArr[i][1];
			}				
			j++;
		}
	}
}
var gAutoPrint = true; // Flag for whether or not to automatically call the print function
function printSpecial(){
	if(document.getElementById != null){
		var html = '<HTML>\n<HEAD>';
		if (document.getElementsByTagName != null){
			var headTags = document.getElementsByTagName("head");
			if (headTags.length > 0)
				html += headTags[0].innerHTML;
		}
		html += '\n</HE' + 'AD>\n<BODY style="background-color:#000000; color:#ffffff; font-size:11px;">\n';
		var printReadyElem = document.getElementById("printReady");
		if (printReadyElem != null){
			html += printReadyElem.innerHTML;
		}else{
			alert("Could not find the printReady section in the HTML");
			return;
		}
		html += '\n</BO' + 'DY>\n</HT' + 'ML>';
		var printWin = window.open("","printSpecial");
		printWin.document.open();
		printWin.document.write(html);
		printWin.document.close();
		if (gAutoPrint){
			printWin.print();
			printWin.close();
		}
	}else{
		alert("Sorry, the print ready feature is only available in modern browsers.");
	}
}	
function fillInfo_new(control,basefield,selectedfield,flag)
{
	//alert(basefield);
	if(basefield=='US')
	{
		//document.getElementById("bl_state_div").innerHTML='';
		//document.getElementById("bl_state_div").innerHTML='<select name="bl_state" id="bl_state" style=" width:250px;"><option value="">Select State</option></select>';
		if(flag=='bill')
		{
			document.getElementById("bl_state_div").style.display='block';
			document.getElementById("bl_state_text_div").style.display='none';
		}
		else
		{
			document.getElementById("sh_state_div").style.display='block';
			document.getElementById("sh_state_text_div").style.display='none';
		}
		
		control.options.length = 0;
		flag = 0;
		for(i=0,j=0; i<fillArr.length; i++)
		{
			if(fillArr[i][0] == basefield)
			{
				if(selectedfield == fillArr[i][1])
				{
					control.options[j] = new Option(fillArr[i][1]+" "+fillArr[i][2]);
					control.options[j].value = fillArr[i][1];
					control.options[j].selected = true;
					flag = 1;
					
				}
				else
				{
					control.options[j] = new Option(fillArr[i][1]+" "+fillArr[i][2]);
					control.options[j].value = fillArr[i][1];
				}				
				j++;
			}
		}
	}
	else
	{
		if(flag=='bill')
		{
			document.getElementById("bl_state_div").style.display='none';
			document.getElementById("bl_state_text_div").style.display='block';
			document.getElementById("bl_state_text").value='';
			
		}
		else
		{
			document.getElementById("sh_state_div").style.display='none';
			document.getElementById("sh_state_text_div").style.display='block';
			document.getElementById("sh_state_text").value='';
		}
	}
	
}	

