// JavaScript Document
function getPartUrl(part) {
  var query = self.location.href;
  if( query.indexOf(part) == -1 ){
  }else{
  	document.write('<img src="images/claypipe-centre-info.jpg" alt="" /><br />');
  }	
}

function shopbutton() {
  var query = self.location.href;
  var length = query.length; // 25
  
  if( query.indexOf('default.php') == -1 ){
	if( length==25 ){ document.write('<a href="store.php"><img src="images/buy-now.jpg" alt="" border="0" /></a>'); }
  }else{
  document.write('<a href="store.php"><img src="images/buy-now.jpg" alt="" border="0" /></a>');
  }	
}

jQuery(document).ready(function()
	{

function processForm() {
				document.location.href= "?action=checkout&view=finishPage";
		}
		
		jQuery("select[name=option_7]").parent("td").html('<input type="text" name="option_7"/>');
		jQuery("select[name=option_9]").parent("td").html('<input type="text" name="option_9"/>');
		jQuery("select[name=option_13]").parent("td").html('<input type="text" name="option_13"/>');
		jQuery("select[name=option_14]").parent("td").html('<input type="text" name="option_14"/>');
		jQuery("select[name=option_15]").parent("td").html('<input type="text" name="option_15"/>');
		jQuery("select[name=option_16]").parent("td").html('<input type="text" name="option_16"/>');
		jQuery("select[name=option_17]").parent("td").html('<input type="text" name="option_17"/>');
		jQuery("select[name=option_18]").parent("td").html('<input type="text" name="option_18"/>');
		jQuery("select[name=option_19]").parent("td").html('<input type="text" name="option_19"/>');
		jQuery("select[name=option_20]").parent("td").html('<input type="text" name="option_20"/>');
		jQuery("select[name=option_21]").parent("td").html('<input type="text" name="option_21"/>');
		jQuery("select[name=option_25]").parent("td").html('<input type="text" name="option_25"/>');
		jQuery("select[name=option_26]").parent("td").html('<input type="text" name="option_26"/>');
		jQuery("select[name=option_27]").parent("td").html('<input type="text" name="option_27"/>');
		
		jQuery("option[value=Ireland]").attr("selected",true);
		
		
		jQuery("form[name=productForm]").validate({
		rules: { option_7: "required", option_9: "required", option_13: "required", option_14: "required", option_15: "required", option_16: "required",
				 option_17: "required", option_18: "required", option_19: "required", option_20: "required", option_21: "required", option_25: "required",
				 option_26: "required", option_27: "required"},
		messages: {	
			option_7: "Please enter the name!", 
			option_9: "Please enter the name!", 
			option_13: "Please enter the name!", 
			option_14: "Please enter the date!", 
			option_15: "Please enter the weight!",
			option_16: "Please fill in Bride's Name!",
			option_17: "Please fill in Groom's Name!",
			option_18: "Please fill in Wedding date!",
			option_19: "Please fill in Bride's Name!",
			option_20: "Please fill in Groom's Name!",
			option_21: "Please fill in Wedding date!",
			option_25: "Please fill in Bride's Name!",
			option_26: "Please fill in Groom's Name!",
			option_27: "Please fill in Wedding date!" } });
		
		/*jQuery("a:contains('Your Cart')").css({'text-size': '14px','font-weight': 'bold'});*/
		jQuery("a:contains('Your Cart')").html('<span class="cart-link">Your Shopping Cart</span>');
		jQuery("span:contains('The product has been added to your shopping cart.')").html('The product has been added to your shopping cart. <a href="store.php?category=1&view=cartPage">View Cart</a>');
		
		
		var query = self.location.href;
  		
		if( query.indexOf('store.php') == -1 ){ }else{ jQuery("div.content-div").attr('class','content-divx'); }
		
		if( query.indexOf('productListPage') == -1 ){
  		}else{
			jQuery("td:contains('OghamName')").css("color", "white");
			jQuery("td:contains('BabyDate')").css("color", "white");
			jQuery("td:contains('BabyWeight')").css("color", "white");
			jQuery("td:contains('ogham_name')").css("color", "white");
			jQuery("td:contains('ogham_date')").css("color", "white");
			jQuery("td:contains('ogham_weight')").css("color", "white");
			
			jQuery("td:contains('BridesName')").css("color", "white");
			jQuery("td:contains('GroomsName')").css("color", "white");
			jQuery("td:contains('WeddingDate')").css("color", "white");
			jQuery("td:contains('brides_name')").css("color", "white");
			jQuery("td:contains('grooms_name')").css("color", "white");
			jQuery("td:contains('wedding_date')").css("color", "white");
		}
	}
);
