function nw (link)

{
				 
	//alert(link)
	window.open(link.href);
 	return false;
}


window.onload = function(){
	

	prepareGallery();	
	setupSlider()
}





function focusOnField(field)
{
//alert(field)
document.forms[0][field].focus()
document.forms[0][field].select()
}



//function to enable the templates select field

function checkPacking(field)

{
	
	

		if (field.checked)
	
		{
			document.forms[0].elements["pallet_quantity"].disabled = false
			
		}
		
		else
		
		{
			document.forms[0].elements["pallet_quantity"].disabled = true
			
		}
	
}


// Title: Tigra Scroller
// Description: See the demo at url
// URL: http://www.softcomplex.com/products/tigra_scroller/
// Version: 1.4
// Date: 07-03-2003 (mm-dd-yyyy)
// Feedback: feedback@softcomplex.com (specify product title in the subject)
// Note: Permission given to use this script in ANY kind of applications if
//    header lines are left unchanged.
// About us: Our company provides offshore IT consulting services.
//     Contact us at sales@softcomplex.com if you have any programming task you
//     want to be handled by professionals.

// set correct path to Tigra Scroller files
var Tscroll_path_to_files = 'scroller/ts_files/'

// please, don't change anything below this line
function Tscroll_init (id) {
	

	document.write ('<iframe id="Tscr' + id + '" scrolling=no frameborder=no src="' + Tscroll_path_to_files + 'scroll.html?' + id + '"  ></iframe>');
}


								



function getExternalLink()	{

	/* check the browser is capable of recognising the DOM objects
	   we need to implement the script - otherwise return false and allow the normal link to be executed */
	   
	if(!document.getElementsByTagName) return false;

	if(!document.getElementsByTagName("a")) return false;
	
	
	
	/* get a listing of all the <p> elements in the page. Then check each one for a title tag of "extLink"
	   If we find such an element, go get a listing of all the childNodes it contains.
	   Then check each one of these for any text which contains "www" - if we find one we know we have a hyperlink
	   so set the target attribute to _blank to force the link to open in a new browser window.
	   We also assign the hyperlink text to the title tag to display for the user */
	
	
	var links = document.getElementsByTagName("p"); 
	var textToSearch
	
						
	if (links.length > 0) {

					for(i = 0; i < links.length; i++) {
								

						if(links[i].getAttribute("title") == "extLink") {
							//var activeLink = links[i].getElementsByTagName("a")
							
							
							for(j = 0; j < links[i].childNodes.length; j++) {
							
								//alert(links[i].childNodes[j].nodeValue + j)

								textToSearch = new String(links[i].childNodes[j])
								
								
								
									if(textToSearch.match("www")) {
										
										
										links[i].childNodes[j].setAttribute("target", "_blank")
										links[i].childNodes[j].setAttribute("title", "link to " + links[i].childNodes[j])
									
										
									
									}
									
							}
						
						}
				

									
																									
					}
			
	}	   
	
}
