// Fixes pages using black background templates

if ( PageName() == 'affiliate_signup.asp' ||
     PageName() == 'myaccount_affiliate.asp' ||
     PageName() == 'myaccount_affiliate_banners.asp' ||
     PageName() == 'kb_results.asp' ||
     PageName() == 'ticket.asp' ||     
     PageName() == 'ticket_list.asp')
document.write("\<style>#content_area td {background: #000000;}<\/style>");

// Fixes multi-child add to cart for black templates

if ( PageName() == 'productdetails.asp') 
document.write("\<style>.smalltext { color:#ffffff; background-color: #000000; }\n.productnamecolorSMALL { color: #ffffff; background-color: #000000; }\n.colors_background_main {background-color:#000000 ! important;}\n.colors_backgroundlight {background-color:#000000 ! important;}<\/style>");

//Fixes error messages on Ticket.asp

if ( PageName() == 'Ticket.asp')
document.write("\<style>#content_area > table > tbody > tr > td > table > tbody > tr > td > font > b {color: #ffffff ! important;}<\/style>");

// Fixes pages using black background templates 

if (PageName() == 'one-page-checkout.asp') 
{
    var list = document.getElementsByTagName("font");
    for (var i = 0; i < list.length; i++)        // search for border color
        if (list[i].color == "#000000") {
            list[i].color = "white";
            break;
        }
}

// to fix address validation background color
 
if ( PageName() == 'one-page-checkout.asp') {
document.write('<' + 'style type="text/css">td#content_area form table tbody tr td table tbody tr td table tbody tr td font li ul {background-color: #000000 ! important;}<' + '/style>');
}




// Checkout Design Styles


if (typeof(jQuery) == 'undefined') document.write('<scr'+'ipt type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></scr'+'ipt>');

//include on category page
if(PageName()=='searchresults.asp' ){
	document.write('<link rel="stylesheet" href="/v/vspfiles/templates/Koral/css/category.css" type="text/css" />');
}
//include on product page
if(PageName()=='productdetails.asp' ){
	document.write('<link rel="stylesheet" href="/v/vspfiles/templates/Koral/css/productdetails.css" type="text/css" />');
}
//include on shopping cart page
if(PageName()=='shoppingcart.asp' ){
	document.write('<link rel="stylesheet" href="/v/vspfiles/templates/Koral/css/shoppingcart.css" type="text/css" />');
}
//include on shopping cart page
if(PageName()=='one-page-checkout.asp' ){
	document.write('<link rel="stylesheet" href="/v/vspfiles/templates/Koral/css/onepagecheckout.css" type="text/css" />');
}




// More JS for the Contact form  - Required fields - 

function formCheck(formobj){
	// Enter name of mandatory fields
	var fieldRequired = Array("First Name", "Last Name", "Email Address", "Phone Number", "Fax Number", "Artist/Model Name", "Date", "Country", "State/Province", "City", "Name of Location", "Time Required", "What will they do", "Offer/Budget Amt", "Additional Info" );
	// Enter field description to appear in the dialog box

var fieldDescription = Array("First Name", "Last Name", "Email Address", "Phone Number", "Fax Number", "Artist/Model Name", "Date", "Country", "State/Province", "City", "Name of Location", "Time Required", "What will they do", "Offer/Budget Amt", "Additional Info" );
	var alertMsg = "Please complete the following fields:\n";
	
	var l_Msg = alertMsg.length;
	
	for (var i = 0; i < fieldRequired.length; i++){
		var obj = formobj.elements[fieldRequired[i]];
		if (obj){
			switch(obj.type){
			case "select-one":
				if (obj.selectedIndex == -1 || obj.options[obj.selectedIndex].text == ""){
					alertMsg += " - " + fieldDescription[i] + "\n";
				}
				break;
			case "select-multiple":
				if (obj.selectedIndex == -1){
					alertMsg += " - " + fieldDescription[i] + "\n";
				}
				break;
			case "text":
			case "textarea":
				if (obj.value == "" || obj.value == null){
					alertMsg += " - " + fieldDescription[i] + "\n";
				}
				break;
			default:
			}
			if (obj.type == undefined){
				var blnchecked = false;
				for (var j = 0; j < obj.length; j++){
					if (obj[j].checked){
						blnchecked = true;
					}
				}
				if (!blnchecked){
					alertMsg += " - " + fieldDescription[i] + "\n";
				}
			}
		}
	}

	if (alertMsg.length == l_Msg){
		return true;
	}else{
		alert(alertMsg);
		return false;
	}
}
// -->
