
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->
var Designdb = new Object()

Designdb["exclusive"] = [
						{id:"0",text:"blossom_branches_blue_8626"},
						{id:"0",text:"blossom_branches_green_8625"},
						{id:"0",text:"blossom_branches_pink_8624"},
						{id:"0",text:"cake_black_pink_8628"},
						{id:"0",text:"cake_blue_pink_8630"},
						{id:"0",text:"cake_brown_multi_8629"},
						{id:"0",text:"cake_brown_pink_8631"},
						{id:"0",text:"cherry_blossom_8627"},
						{id:"0",text:"flower_blue_8642"},
						{id:"0",text:"flower_orange_8643"},
						{id:"0",text:"flower_pink_8640"},
						{id:"0",text:"flower_purple_8641"},
						{id:"0",text:"monogram_circle_blue_5258007"},
						{id:"0",text:"monogram_circle_lavender_5258005"},
						{id:"0",text:"monogram_circle_pink_5258004"},
						{id:"0",text:"monogram_circle_sage_5258006"},
						{id:"0",text:"monogram_dots_blue_8638"},
						{id:"0",text:"monogram_dots_green_8637"},
						{id:"0",text:"monogram_dots_pink_8636"},
						{id:"0",text:"monogram_square_gray_5258003"},
						{id:"0",text:"ring_8639"},
						{id:"0",text:"ring_and_band_black_8635"},
						{id:"0",text:"ring_and_band_blue_8634"},
						{id:"0",text:"ring_and_band_green_8633"},
						{id:"0",text:"ring_and_band_pink_8632"},
						{id:"0",text:"umbrella_blue_8620"},
						{id:"0",text:"umbrella_brown_8622"},
						{id:"0",text:"umbrella_green_8621"},
						{id:"0",text:"umbrella_pink_8623"},
						{id:"0",text:"winter_wedding_snowflakes_40800"},
						];
Designdb["beach"] = [
						{id:"15", text:"beach_path_5250173"},
						{id:"16", text:"hibiscus_print_blue_5250157"},
						{id:"17", text:"hibiscus_print_green_5250159"},
						{id:"18", text:"hibiscus_print_pink_5250158"},
						{id:"19", text:"hibiscus_print_purple_5250160"},
						{id:"21", text:"life_is_good_beach_chairs_5250116"},
						{id:"20", text:"life_is_good_flip_flops_5250118"},
						{id:"22", text:"life_is_good_palm_trees_5250117"},
						{id:"23", text:"mosaic_palm_trees_5250169"},
						{id:"24", text:"multicolored_hibiscuses_5250161"},
						{id:"25", text:"palm_trees_photo_5250170"},
						{id:"26", text:"perfect_fit_flip_flop_bar_5250164"},
						{id:"27", text:"perfect_fit_simple_flip_flops_5250163"},
						{id:"28", text:"sandy_beach_photo_5250172"},
						{id:"29", text:"stripes_gray_sea_shell_5250166"},
						{id:"30", text:"swaying_palm_trees_5250168"},
						{id:"31", text:"swirly_border_with_shells_5250167"},
						{id:"310",text:"two_beach_chairs_photo_5250171"},
						{id:"32", text:"water_brushed_sea_shells_5250165"},
						{id:"33", text:"watercolor_hibiscuses_5250162"},
						];
Designdb["monogram"] = [
						 {id:"34", text:"antique_cameo_5251021"},
						{id:"35", text:"argyle_blue_and_brown_5251033"},
						{id:"29", text:"argyle_pink_and_brown_5251032"},
						{id:"30", text:"argyle_pink_and_green_5251034"},
						{id:"31", text:"classic_frame_blue_5251028"},
						{id:"32", text:"classic_frame_green_5251029"},
						{id:"33", text:"classic_frame_orange_5251030"},
						{id:"34", text:"classic_frame_pink_5251027"},
						{id:"35", text:"classic_frame_purple_5251031"},
						{id:"36", text:"dots_and_stripes_blue_5251004"},
						{id:"37", text:"dots_and_stripes_pink_5251003"},
						{id:"38", text:"fairytale_vines_pink_5251022"},
						{id:"39", text:"lots_of_dots_blue_5251002"},
						{id:"40", text:"lots_of_dots_pink_5251001"},
						{id:"41", text:"modern_diamond_blue_5251006"},
						{id:"42", text:"modern_diamond_green_5251007"},
						{id:"43", text:"modern_diamond_pink_5251005"},
						{id:"44", text:"modern_diamond_purple_5251008"},
						{id:"45", text:"satin_ribbon_blue_5251015"},
						{id:"46", text:"satin_ribbon_green_5251016"},
						{id:"47", text:"satin_ribbon_pink_5251014"},
						{id:"48", text:"satin_ribbon_purple_5251017"},
						{id:"49", text:"simply_elegant_black_5251018"},
						{id:"50", text:"simply_elegant_blue_5251020"},
						{id:"51", text:"simply_elegant_pink_5251019"},
						{id:"52", text:"victorian_lace_black_5251023"},
						{id:"53", text:"victorian_lace_gold_5251026"},
						{id:"54", text:"victorian_lace_red_5251024"},
						{id:"55", text:"victorian_lace_blue_5251025"},
						{id:"56", text:"wildflowers_black_and_white_5251013"},
						{id:"57", text:"wildflowers_blue_5251010"},
						{id:"58", text:"wildflowers_green_5251011"},
						{id:"59", text:"wildflowers_orange_5251012"},
						{id:"60", text:"wildflowers_pink_5251009"}
						];


					
Designdb["classic"] = [{id:"62", text:"china_cups_5250103"},
						{id:"63", text:"las_vegas_welcome_sign_5250146"},
						{id:"64", text:"perfect_blend_kissing_cups_5250101"},
						{id:"65", text:"shooting_stars_5250140"},
						{id:"66", text:"tea-rific_couple_kissing_cups_5250102"},
						{id:"67", text:"three_circles_hearts_5250145"},
						{id:"68", text:"three_circles_mugs_5250144"},
						{id:"69", text:"two_butterflies_5250141"},
						{id:"70", text:"waving_american_flag_5250142"},
						{id:"700", text:"whimsical_bride_and_groom_5250174"},
						];
Designdb["floral"] = [
					  	{id:"71", text:"brewing_black_and_white_5250106-BW"},
						{id:"72", text:"brewing_lavender_5250106-L"},
						{id:"73", text:"brewing_pink_5250106-P"},
						{id:"74", text:"brewing_sepia_5250106-S"},
						{id:"75", text:"corner_daisies_5250137"},
						{id:"171", text:"garden_floral_5250104"},
						{id:"172", text:"peach_roses_5250139"},
						{id:"173", text:"perfect_blend_pink_roses_5250109"},
						{id:"174", text:"red_roses_5250138"},
						{id:"175", text:"white_flower_5250119"},
						];
Designdb["golf"] = [
						{id:"76", text:"couple_in_golf_cart_5250133"},
						{id:"77", text:"early_morning_golf_course_5250136"},
						{id:"78", text:"golf_flag_fairway_5250135"},
						{id:"79", text:"kissing_golf_balls_5250131"},
						{id:"80", text:"two_flags_heart_shaped_5250132"},
						{id:"81", text:"two_golf_balls_on_tees_5250134"},
						];
Designdb["fall"] = [
						{id:"82", text:"leaf_banner_5250121"},
						{id:"83", text:"leaf_imprints_5250122"},
						{id:"84", text:"leaves_cascading_5250123"},
						{id:"85", text:"two_leaves_5250120"},
						];
Designdb["winter"] = [
						{id:"86", text:"kissing_snow_couple_5250124"},
						{id:"87", text:"perfect_fit_mittens_5250129"},
						{id:"88", text:"single_snowflake_5250127"},
						{id:"89", text:"snow_cascading_5250126"},
						{id:"86", text:"tis_the_season_5250128"},
						{id:"87", text:"two_pine_cones_5250125"},
						{id:"88", text:"wedding_wonderland_5250130"},
						{id:"89", text:"winter_wedding_snowflakes_40800"},
						];
function setCities(chooser) {
    var newElem;
    var where = (navigator.appName == "Microsoft Internet Explorer") ? -1 : null;
    var AttributeValueChooser = document.getElementById('color');
    while (AttributeValueChooser.options.length) {
        AttributeValueChooser.remove(0);
    }
    var choice = chooser.options[chooser.selectedIndex].id;
    var db = Designdb[choice];
    newElem = document.createElement("option");
    newElem.text = "choose a design";
    newElem.id = "";
	newElem.value = "0";
    AttributeValueChooser.add(newElem, where);
    if (choice != "") {
			if(db)
        for (var i = 0; i < db.length; i++) {
            newElem = document.createElement("option");
            newElem.text = db[i].text;
            newElem.id = db[i].id;
            AttributeValueChooser.add(newElem, where);
        }
    }
}






$(document).ready(function(){
function setMaxLength(element_id, length){
        $(element_id).attr("maxlength", length);
        note = element_id + '_note';
		if (length > 1) {
			$(note).html('(up to ' + length + ' characters)');
		}else{
			$(note).html('(up to ' + length + ' character)');
		}
    }
$("#design").bind("change", function(e){
	textfieldchange();
	});
$("#color").bind("change", function(e){
	textfieldchange();
	});	
	 function textfieldchange(){
	 	var design = $("#design").val();
	 	var color = $("#color").val();
	 	$('#3_text1').val('');
	 	$('#4_text2').val('');
	 	$('#5_monogram').val('');
	 	$('#6_initial_1').val('');
	 	$('#7_initial_2').val('');
	 	$('#8_names').val('');
	 	$('#9_date').val('');
	 		$('#3_text1div').hide();
	 		$('#4_text2div').hide();
	 		$('#5_monogramdiv').hide();
	 		$('#6_initial_1div').hide();
	 		$('#7_initial_2div').hide();
	 		$('#8_namesdiv').hide();
	 		$('#9_datediv').hide();
	 		$('#10_specialdiv').show();
	 	if (color == "blossom_branches_blue_8626" || color == "blossom_branches_green_8625" || color == "blossom_branches_pink_8624" || color == "cake_black_pink_8628" || color == "cake_blue_pink_8630" || color == "cake_brown_multi_8629" || color == "cake_brown_pink_8631" || color == "cherry_blossom_8627" || color == "flower_blue_8642" || color == "flower_orange_8643" || color == "flower_pink_8640" || color == "flower_purple_8641" || color == "ring_8639" || color == "ring_and_band_black_8635" || color == "ring_and_band_blue_8634" || color == "ring_and_band_green_8633" || color == "ring_and_band_pink_8632" || color == "umbrella_blue_8620" || color == "umbrella_brown_8622" || color == "umbrella_green_8621" || color == "umbrella_pink_8623") {
	 		
	 		$('#3_text1div').show();
	 		$('#4_text2div').show();
	 		$('#5_monogramdiv').hide();
	 		$('#6_initial_1div').hide();
	 		$('#7_initial_2div').hide();
	 		$('#8_namesdiv').hide();
	 		$('#9_datediv').hide();
	 		$('#10_specialdiv').show();
	 	}
	 	if (color == "monogram_dots_blue_8638" || color == "monogram_dots_green_8637" || color == "monogram_dots_pink_8636") {
	 		
			setMaxLength('#5_monogram', 1);
	 		$('#3_text1div').show();
	 		$('#4_text2div').show();
	 		$('#5_monogramdiv').show();
	 		$('#6_initial_1div').hide();
	 		$('#7_initial_2div').hide();
	 		$('#8_namesdiv').hide();
	 		$('#9_datediv').hide();
	 		$('#10_specialdiv').show();
	 	}if(color=="monogram_circle_blue_5258007"||color=="monogram_circle_lavender_5258005"||color=="monogram_circle_pink_5258004"||color=="monogram_circle_sage_5258006"){
			
			setMaxLength('#5_monogram', 1);
	 		$('#3_text1div').hide();
	 		$('#4_text2div').hide();
	 		$('#5_monogramdiv').show();
	 		$('#6_initial_1div').hide();
	 		$('#7_initial_2div').hide();
	 		$('#8_namesdiv').show();
	 		$('#9_datediv').show();
	 		$('#10_specialdiv').show();
		}
		if(color=="monogram_square_gray_5258003"){
			setMaxLength('#6_initial_1', 1);
	 		setMaxLength('#7_initial_2', 1);
			setMaxLength('#5_monogram', 1);
	 		$('#3_text1div').hide();
	 		$('#4_text2div').hide();
	 		$('#5_monogramdiv').hide();
	 		$('#6_initial_1div').show();
	 		$('#7_initial_2div').show();
	 		$('#8_namesdiv').hide();
	 		$('#9_datediv').show();
	 		$('#10_specialdiv').show();
		}
		if(color=="winter_wedding_snowflakes_40800"){
	 		$('#3_text1div').hide();
	 		$('#4_text2div').hide();
	 		$('#5_monogramdiv').hide();
	 		$('#6_initial_1div').hide();
	 		$('#7_initial_2div').hide();
	 		$('#8_namesdiv').show();
	 		$('#9_datediv').show();
	 		$('#10_specialdiv').show();
		}if(design=="classic"){
			$('#3_text1div').hide();
	 		$('#4_text2div').hide();
	 		$('#5_monogramdiv').hide();
	 		$('#6_initial_1div').hide();
	 		$('#7_initial_2div').hide();
	 		$('#8_namesdiv').show();
	 		$('#9_datediv').show();
	 		$('#10_specialdiv').hide();
		}if(color=="antique_cameo_5251021"||color=="argyle_blue_and_brown_5251033"||color=="argyle_pink_and_brown_5251032"||color=="argyle_pink_and_green_5251034"||color=="dots_and_stripes_blue_5251004"||color=="dots_and_stripes_pink_5251003"||color=="fairytale_vines_pink_5251022"||color=="lots_of_dots_blue_5251002"||color=="lots_of_dots_pink_5251001"||color=="modern_diamond_blue_5251006"||color=="modern_diamond_green_5251007"||color=="modern_diamond_pink_5251005"||color=="modern_diamond_purple_5251008"||color=="satin_ribbon_blue_5251015"||color=="satin_ribbon_green_5251016"||color=="satin_ribbon_pink_5251014"||color=="satin_ribbon_purple_5251017"||color=="simply_elegant_black_5251018"||color=="simply_elegant_blue_5251020"||color=="simply_elegant_pink_5251019"||color=="wildflowers_black_and_white_5251013"||color=="wildflowers_blue_5251010"||color=="wildflowers_green_5251011"||color=="wildflowers_orange_5251012"||color=="wildflowers_pink_5251009")
		{
			setMaxLength('#5_monogram', 3);
			$("#5_monogram_note").html('(small initial, large initial, small initial)');
			$('#3_text1div').hide();
	 		$('#4_text2div').hide();
	 		$('#5_monogramdiv').show();
	 		$('#6_initial_1div').hide();
	 		$('#7_initial_2div').hide();
	 		$('#8_namesdiv').hide();
	 		$('#9_datediv').show();
	 		$('#10_specialdiv').hide();
		}if(color=="classic_frame_blue_5251028"||color=="classic_frame_green_5251029"||color=="classic_frame_orange_5251030"||color=="classic_frame_pink_5251027"||color=="classic_frame_purple_5251031"||color=="victorian_lace_black_5251023"||color=="victorian_lace_gold_5251026"||color=="victorian_lace_red_5251024"||color=="victorian_lace_blue_5251025")
		{	setMaxLength('#6_initial_1', 1);
			$('#6_initial_1label').html('Initial');
			$('#3_text1div').hide();
	 		$('#4_text2div').hide();
	 		$('#5_monogramdiv').hide();
	 		$('#6_initial_1div').show();
	 		$('#7_initial_2div').hide();
	 		$('#8_namesdiv').show();
	 		$('#9_datediv').hide();
	 		$('#10_specialdiv').hide();
		}if(design=="golf" || design=="floral"||design=="beach"||design=="fall"||design=="winter"){
			$('#3_text1div').hide();
	 		$('#4_text2div').hide();
	 		$('#5_monogramdiv').hide();
	 		$('#6_initial_1div').hide();
	 		$('#7_initial_2div').hide();
	 		$('#8_namesdiv').show();
	 		$('#9_datediv').show();
	 		$('#10_specialdiv').hide();
		}
		};
	});
