// Copyright 2003-2004, Rod Mancisidor and Alejandra Sanchez-Frank.
// All rights reserved.
// Use of this software prohibited except by written permission from the authors.

// Javascript to hide a URL to prevent javascript-disabled systems from
// following a link to a page that requires javascript ------------------------

function goTo(url) {
	location.href = url;
}

// function used by help popup window -----------------------------------------

function closeWindow() {
	close();
}

function getAuxWindow() {
	// if there is no aux window, create it with the right features
	var height=600, width=400, top=0, left=0;
	if (window && window.screen) {
		var screen = window.screen;
		if (screen.availHeight) {
			height = screen.availHeight - 80;
			if (height > 600) {
				height = 600;
			}
		}
		if (screen.availWidth) {
			width = screen.availWidth - 80;
			if (width > 400) {
				width = 400;
			}
		}
		top  = screen.availTop  || 0;
		left = screen.availLeft || 0;
	}
	return window.open('', 'auxWindow',
					   'height=' + height +
					   ',width=' + width  +
					   ',top='   + top    +
					   ',left='  + left   +
					   ',location=yes,menubar=yes,resizable=yes' +
					   ',scrollbars=yes,status=yes,toolbar=yes');
}

function helpFor(subject, url) {
	// if there is no auxiliary window, create it with the right features
	// for static pages, use the provided url (which already has at least one
	// arg--the toPage).
	if (url) {
		var handle = getAuxWindow();
		handle.location.href = url + ',FieldHlp-' + subject;
	// for dynamic pages, set the help field and submit to the hlpPage
	} else {
		_setField('FieldHlp', subject);
		submitFormToAux(getElem('hlpPage').value);
	}
}

// *************   L O G I P I C K   *************************************
function sendFeedback() {
	// if there is no auxiliary window, create it with the right features
	var handle = getAuxWindow();
	// request the feedback page in the auxiliary window
	handle.location.href = '~toPage-PageFeedbackBiz';
}

function sendMail(toPage) {
	// if there is no auxiliary window, create it with the right features
	var handle = getAuxWindow();
	// request the mail page in the auxiliary window
	handle.location.href = '~toPage-' + (toPage || 'PageMailBiz');
}

function infoFromAmazon(asin) {
	// avoid double backslash to prevent compression from treating it as comment
	var url = '/url?url=' +
		escape('http:/' + '/www.amazon.com/exec/obidos/ASIN/' +
			   asin +
			   '/ref=nosim/wwwlogipickco-20');
	location.href = url;
}

// code adapted from amazon to order an item directly
function buyFromAmazon(asin) {
	// avoid double backslash to prevent compression from treating it as comment
	var url = '/url?url=' +
		escape('http:/' + '/buybox.amazon.com/exec/obidos/redirect?' +
			   'tag=wwwlogipickco-20&' +
			   'link_code=qcb&' +
			   'creative=23424&' +
			   'camp=2025&' +
			   'path=/dt/assoc/tg/aa/xml/assoc/-/' +
			   asin +
			   '/wwwlogipickco-20/ref%3Dac_bb6_');
	var amznwin=window.open(url,
							'_amazon',
							'location=yes,scrollbars=yes,status=yes,' +
							'toolbar=yes,resizable=yes,width=380,height=450,' +
							'screenX=10,screenY=10,top=10,left=10');
	amznwin.focus();
}
 
// code for GoogleAds

google_ad_client    = "pub-3070365789437595";
google_alternate_color = "FFFFFF";
google_ad_type      = "text_image";
google_ad_channel   = "";
google_color_border = "000033";
//google_color_bg     = "ECF8FF";
google_color_bg     = "EEEEFF";
google_color_link   = "0000CC";
google_color_url    = "008000";
google_color_text   = "000033";

function verticalGoogleAds() {
    google_ad_width  = 120;
    google_ad_height = 600;
    google_ad_format = "120x600_as";
}

function horizontalGoogleAds() {
    google_ad_width  = 728;
    google_ad_height = 90;
    google_ad_format = "728x90_as";
    google_color_link   = "ff6600";
    google_color_bg     = "CCCCFF";
}

function wideVerticalGoogleAds() {
    google_ad_width = 160;
    google_ad_height = 600;
    google_ad_format = "160x600_as";
}

function largeRectGoogleAds() {
    google_ad_width = 336;
    google_ad_height = 280;
    google_ad_format = "336x280_as";
}

