// ---------------------------------------------
//     This file is for initialization only!
// - - - - - - - - - - - - - - - - - - - - - - -
//         DO NOT CHANGE ANYTHING!!
// ---------------------------------------------
// Last change: 2006-10-27

// reading a variable in the parsed string
function getParm(string,parm) {
	string = string.replace(/%26/g,"&")
	var startPos= string.indexOf(parm+"=")
	if (startPos> -1) {
		startPos= startPos+parm.length+1
		var endPos= string.indexOf("&",startPos)
		if (endPos== -1) endPos= string.length
		//alert(string+ ": string.substring("+startPos+","+endPos+") = "+string.substring(startPos,endPos))
		return unescape(string.substring(startPos,endPos))
	}
	return ''
}
// cookie functions
function Get_Cookie(name) {
	var start = document.cookie.indexOf(name+"=");
	var len = start+name.length+1;
	if ((!start) && (name != document.cookie.substring(0,name.length))) return "";
	if (start == -1) return "";
	var end = document.cookie.indexOf(";",len);
	if (end == -1) end = document.cookie.length;
	return unescape(document.cookie.substring(len,end));
}
function Set_Cookie(name, value, expires, path, domain, secure) {
	document.cookie = name + "=" +escape(value) +
			( (expires) ? ";expires=" + expires.toGMTString() : "") +
			( (path) ? ";path=" + path : "") + 
			( (domain) ? ";domain=" + domain : "") +
			( (secure) ? ";secure" : "");
}
function Delete_Cookie(name, path, domain) {
	if (Get_Cookie(name))
		document.cookie = name + "=" +
		( (path) ? ";path=" + path : "") +
		( (domain) ? ";domain=" + domain : "") +
		";expires=Thu, 01-Jan-1970 00:00:01 GMT";
}

// Read parameters from URL
parsed		= window.location.search.substring(1)
prefCode	= getParm(parsed,"code")	// alternate settings
gotoPage	= getParm(parsed,"show")	// start image page
langID		= getParm(parsed,"lid")		// alternate language
order		= getParm(parsed,"order")
page		= getParm(parsed,"page")	// start index page
secPage		= getParm(parsed,"secpage")	// section page
starts		= getParm(parsed,"starts")	// first image in section
selection	= getParm(parsed,"select")	// limited view
ends		= getParm(parsed,"ends")	// last  image in section
slide		= getParm(parsed,"slide")
delay		= getParm(parsed,"delay")
orderpreview	= getParm(parsed,"preview")	// large images or thumbs
printme		= getParm(parsed,"print")
startnew	= getParm(parsed,"reset")

// get the file extension (used in older versions)
var myAddr  = location.pathname
var myFile  = myAddr.substring(myAddr.lastIndexOf('/')+1, myAddr.length)
myExtension = myFile.substring(myFile.lastIndexOf(".")  , myFile.length)
if(myExtension == "") myExtension = ".htm"	// default for older galleries


// set path variables to default values if undefined (no dirsetup.js)
if(typeof(common_DIR)	    =="undefined") common_DIR		= ""
if(common_DIR == "") common_DIR = "./"
if(typeof(common_images_DIR)=="undefined") common_images_DIR	= common_DIR + "/images"
if(typeof(settings2_DIR)    =="undefined") settings2_DIR	= common_DIR + "/setup2"
if(typeof(settingsc_DIR)    =="undefined") settingsc_DIR	= common_DIR
if(typeof(settings3_DIR)    =="undefined") settings3_DIR	= "."


// correct path names (add traling slash)
if(common_images_DIR != "") common_images_DIR = common_images_DIR.replace(/\/$/,"") + "/"
if(settings2_DIR != "")     settings2_DIR     = settings2_DIR.replace(/\/$/,"") + "/"
if(settingsc_DIR != "")     settingsc_DIR     = settingsc_DIR.replace(/\/$/,"") + "/"
if(settings3_DIR != "")     settings3_DIR     = settings3_DIR.replace(/\/$/,"") + "/"

// add path info to the include files
var settings_file	= common_DIR    + "settings.js"
var settings2_file	= settings2_DIR + "settings2.js"
var settingsc_file	= settingsc_DIR + "settings" + prefCode + ".js"
var settings3_file	= settings3_DIR + "settings3.js"
var language_en_file	= common_DIR    + "language_en.js"
var scripts_file	= common_DIR    + "scripts.js"
var overlibmws_file	= common_DIR    + "overlibmws.js"
var overlibmws_file2	= common_DIR    + "overlibmws_hide.js"
// add include text to the include files
var incl_settings	= '<script type="text/javascript" src="' + settings_file    + '"><\/script>'
var incl_settings2	= '<script type="text/javascript" src="' + settings2_file   + '"><\/script>'
var incl_settingsc	= '<script type="text/javascript" src="' + settingsc_file   + '"><\/script>'
var incl_settings3	= '<script type="text/javascript" src="' + settings3_file   + '"><\/script>'
var incl_language_en	= '<script type="text/javascript" src="' + language_en_file + '"><\/script>'
var incl_scripts	= '<script type="text/javascript" src="' + scripts_file     + '"><\/script>'
var incl_overlibmws	= '<script type="text/javascript" src="' + overlibmws_file  + '"><\/script>'
			+ '<script type="text/javascript" src="' + overlibmws_file2 + '"><\/script>'

// logout
var myPath = location.pathname.substring(0,location.pathname.lastIndexOf('/'))
if(startnew == 2) {
	var myDomain = "." + location.hostname.replace(/^[Ww][Ww][Ww]\./, "")
	Delete_Cookie("localpw", myPath, myDomain)
}


// initialize all variables from settings.js
// (variable list in alphabetical order)
//
// DO NOT EDIT VALUES IN THIS FILE!!
// -> they will get overwritten from settings.js
var acceptCC			= ""
var acceptTerms			= 0
var addr_format			= "csz"
var allImagesZoomified		= 0
var allow_largeImages		= 0
var allow_sendImageLink		= 0
var allow_specialItems_in_containers = 0
var applType			= ""
var applVersion			= ""
var auth_id			= ""
var auth_currency		= ""
var auth_interface		= ""
var auth_test			= ""
var ccFile			= ""
var CC_accept			= ""
var CC_cardList			= ""
var CC_securityCode		= 1
var CheckboxInfo1		= ""
var CheckboxInfo2		= ""
var CheckboxInfo3		= ""
var checkoutOption		= new Array()
var checkoutTextfile		= ""
var clickFullsize		= 0
var commentBoxCols		= 35
var commentBoxRows		= 5
var copyrightMsg		= ""
var couponCode_execution	= 1
var credit_taxable		= 0
var currency			= "$"
var customer_addr1		= 0
var customer_addr2		= 0
var customer_city		= 0
var customer_county		= 0
var customer_country		= 0
var customer_email		= 2
var customer_email2		= 0
var customer_fax		= 0
var customer_phone		= 0
var customer_phone2		= 0
var customer_state		= 0
var customer_text1		= 0
var customer_user1		= 0
var customer_user2		= 0
var customer_user3		= 0
var customer_zip		= 0
var debts_taxable		= 0
var decimal			= "."
var defaultCountry		= ""
var defaultDelay		= 3
var defaultState		= ""
var demo_2checkout		= 1
var descriptionPlace		= 1
var discountByCopies		= new Array()
var discountByTotal		= new Array()
var DiscountByTotal_fixed	= 0
var email_address		= ""
var email_subject		= ""
var eosmail_script		= ""
var errorPage 			= "about:blank"
var eventDate			= ""
var eventType			= ""
var ewayCustomerID		= ""
var expDate_DiscountByTotal	= ""		
var expDate_DiscountByCopies	= ""		
var expirationDate		= ""
var expireDateFile		= ""
var expiredFile			= ""
var filePrefix			= ""
var fixed_DebtsValue		= 0
var fixed_CreditValue		= 0
var fullsize_3Dborder		= 1
var freeShippingLimit		= 0
var galleryID			= ""
var galleryID2			= ""
var galleryIndex		= ""
var GalleryLink_inOrder		= 1
var gif_download		= "download.gif"
var gif_next			= "rarr.gif"
var gif_popup			= "popup.gif"
var gif_prev			= "larr.gif"
var gif_tagged			= "star.gif"
var global_itemOptions		= ""
var hide_ItemOrderTable		= 0
var ignore_specialItems 	= 0
var imageComments		= 0
var imagePath			= ""
var imagePreparationFee		= 0
var includeImageLinks		= 0
var introTextfile		= ""
var introTextfile_section	= 0
var item			= new Array()
var itemOptions			= new Array()
var language			= "en"
var language_name		= ""
var language_flag		= ""
var language2			= ""
var language2_name		= ""
var language2_flag		= ""
var licenseKey			= ""
var loginScript			= ""
var logoLink			= ""
var mals_domain			= ""
var mals_id			= ""
var master_pwFile		= ""
var maxShippingLimit		= 0
var minimum_orderAmount		= 0
var mouseOverColor		= "#dddddd"
var musicFile			= ""
var myCity			= ""
var myCountry			= ""
var myEmail			= ""
var myFax			= ""
var myLogo			= ""
var myName			= ""
var myPhone1			= ""
var myPhone2			= ""
var myState			= ""
var myStreet			= ""
var myStyleFile			= "style.css"
var myWWW			= ""
var myZip			= ""
var navigationBar_width 	= 620
var nochex_email		= ""
var noFileExtension		= 0
var noImageRightClick		= 0
var noOrderFunction		= 0
var noPrintScreen		= 0
var noTopTitle			= 0
var noWindowRightClick		= 0
var numberSections		= 0
var numColumns			= 4
var numRows			= 3
var ol_bgcolor			= "#333333"
var ol_fgcolor			= "#eeeeee"
var ol_textfont			= "Arial,Helvetica"
var orderOptions_height		= 0
var overlayOpacity		= 45
var overwriteWindowTitle	= 0
var pagesSelect			= 0
var paymateUser			= "demonstration"
var paypalAccount		= ""
var pmCurrency			= "USD"
var ppAddEmailLink		= 0
var ppCurrency			= "USD"
var ppLanguage			= "US"
var ppLanguage2			= "US"
var pri_MerchID			= ""
var pri_RegKey			= ""
var printThumbs_option		= 1
var proof_ls 			= ""
var proof_pt 			= ""
var protx_currency		= "GBP"
var protx_passw			= ""
var protx_test			= 1
var protx_vendorName		= ""
var proofingWithLightbox	= 0
var psi_merchantID		= ""
var psi_test			= 1
var pwFile			= ""
var repeatNavigation		= 0
var repeatSectionList		= 0
var rev_specialItems		= 0
var saveSpace			= 0
var sc_invisible		= 1
var sc_partition		= ""
var sc_project			= ""
var sc_security			= ""
var secp_user			= ""
var secp_currency		= ""				
var secp_test			= 1
var secp_callback		= ""
var sectionsSelect		= 1
var sectionPages		= 1
var sectionPagesSelect		= 0
var sectionThumbnail		= new Array()
var selfPickup			= 0
var shadow			= 0
var shipOption			= new Array()
var shippingFixAmount		= 0
var shippingPercentage		= 0
var shippingPerItem		= 0
var show_back2start		= 0
var show_CreditField		= 0
var show_DebtsField		= 0
var show_ImageLinks		= 1
var showCalcDetails		= 0
var showCartButtons_2x		= 0
var showCount			= 0
var showIndexPopup		= 0
var showIndexDownload		= 0
var showIndexLightbox		= 0
var showIndexTaggedInfo		= 0
var showPaypalCountriesOnly	= 1
var showQtyButtons		= 1
var showRankingInfo		= 0
var showSectionInOrderText	= 0
var showSlideshow		= 1
var showTaggedInfo		= 0
var showUpdateAlert		= 0
var showUpdateCartButton	= 0
var sid_2checkout		= "1"
var skj_serialno		= ""
var skj_test			= 1
var slideshowAllSections	= 1
var specialItem			= new Array()
var specialSectionThumbs	= 0
var StartIndexPage		= ""
var storename			= "1"
var suppressIndexThumbs		= 0
var suppressSectionThumbs	= 0
var tax2Always 			= 0
var tax2Percentage		= 0
var tax2State 			= ""
var tax_inclShipping		= 0
var taxAlways 			= 0
var taxPercentage		= 0
var taxState 			= ""
var templateVersion		= ""
var termsFile			= ""
var TextFile			= ""
var thumbnailCaption		= "filename"
var topLogo			= ""
var topStyleFile		= ""
var use_proofOverlay		= 0
var useDDirNameAsTitle		= 0
var useDiscountByCopies		= 0
var useDiscountByTotal		= 0
var useDiscountOne4Free		= 0
var useSDirNameAsTitle		= 0
var useSections			= 0
var VAT				= 0
var vat_exclShipping		= 0
var wp_instId			= ""
var wp_currency			= ""
var wp_lang			= "en"
var wp_test			= 1
var zoomifiedKeyword		= "zoom"
var zoomInLargeImage		= 1

// ------------------------------------
// NEW TEXT VARS
// ------------------------------------
image_number	= "image #"
section_pages	= "part"
back_to_start	= "Back to Index<br>"
back_to_gall	= "Exit &raquo;<br>"	// old
txt_prepFee	= "image preparation fee"
txt_totalDisc	= "The subtotal includes a total discount of"
txt_expire_dbt1	= "Order early and get a "
txt_expire_dbt2 = "special discount"	// linked text
txt_expire_dbt3 = " until <b> "
txt_expire_dbc1 = "Order early and get a "
txt_expire_dbc2 = "special discount"	// linked text
txt_expire_dbc3 = " until <b> "
txt_expire_note = "<br>(Discount taken on check out.)"
alert_reset	= "Click \"OK\" if you really want to loose\n"
	+ "all order information and start a new order!\n\n"
	+ "Click \"Cancel\" if you want to continue with this order."
txt_confirmExit = "That would cancel your order for this gallery! Are you sure you want to leave?"
txt_confirmReset= "Do you really want to reset the cart?"
// alert_home and alert_gallery	are obsolete now!

protxAlert	= "The order will now be submitted online\n"
protxAlert     += "and you will be forwarded to PROTX.com.\n\n"
protxAlert     += "Please press \"OK\" to proceed.\n"
