function ClearSearch() {
	try {
		var element = window.document.getElementById('SearchKeywords');
		if(element.value=='Search'){
			element.value='';
		}else{}
	} catch(e) {}
}

function WriteSearch() {
	try {
		var element = window.document.getElementById('SearchKeywords');
		if(element.value==''){
			element.value='Search';
		}else{}
	} catch(e) {}
}


ReplaceSearch = function() {
	try {
		var elements = window.document.getElementById('SearchKeywords');
		if(window.addEventListener){	
			elements.addEventListener('focus', ClearSearch, true);
			elements.addEventListener('blur', WriteSearch, true);	
		}else{
			elements.attachEvent("onfocus",ClearSearch);
			elements.attachEvent("onblur",WriteSearch);
		}
	} catch(e) {}
}


if(window.addEventListener) window.addEventListener('load', ReplaceSearch, false); // gecko, safari, konqueror and standard
else if(document.addEventListener) document.addEventListener('load', ReplaceSearch, false); // opera 7
else if(window.attachEvent) { // win/ie
	window.attachEvent('onload', ReplaceSearch);
} else { // mac/ie5
	if(typeof window.onload == 'function') {
		var existing = onload;
		window.onload = function() {
			existing();
			ReplaceSearch();
		}
	} else {
		window.onload = function() {
			ReplaceSearch();
		}
	}
}

// Flash video and link insertion

function WriteFlashClick(VidFile,ThumbFile) {
	try {
		var playerVersion = swfobject.getFlashPlayerVersion(); // returns a JavaScript object
		if (swfobject.hasFlashPlayerVersion("9.0.0")) {
			swfobject.embedSWF("/files/flash/flvplayer.swf", "VidClip", "320", "240", "9.0.0", false, {file:VidFile, image:ThumbFile, width:"320", height:"240", autostart:"true", overstretch:"none"}, {allowfullscreen:"true", wmode:"transparent"}, false );
		}else{}
	} catch(e) {}
}


function WriteFlashClickWithWidthHeight(VidFile,ThumbFile,width,height) {
	try {
		var playerVersion = swfobject.getFlashPlayerVersion(); // returns a JavaScript object
		if (swfobject.hasFlashPlayerVersion("9.0.0")) {
			swfobject.embedSWF("/files/flash/flvplayer.swf", "VidClip", width, height, "9.0.0", false, {file:VidFile, image:ThumbFile, width:width, height:height, autostart:"true", overstretch:"none"}, {allowfullscreen:"true", wmode:"transparent"}, false );
		}else{}
	} catch(e) {}
}



function WriteFlash(SWFPath,SWFWidth,SWFHeight,SWFParams) {
	try {
		var str = '\n';
		var NewParams = '';
		str+='	<object type="application\/x-shockwave-flash" data="' + SWFPath + '" width="' + SWFWidth + '" height="' + SWFHeight + '" title="">\n';
		str+='		<param name="wmode" value="transparent">\n';
		str+='		<param name="movie" value="' + SWFPath + '">\n';
		if(typeof(SWFParams) != "undefined"){
			var SWFParamsArray = SWFParams.split(';');
			for (var i=0; i<SWFParamsArray.length; i++) {
				var EachParam = SWFParamsArray[i].split(',');
				NewParams+='		<param name="' + EachParam[0] + '" VALUE="' + EachParam[1] + '">\n';
			}
			str+=NewParams;
		}
		str+='	<\/object>\n';
		document.write(str);
	} catch(e) {}
}

function disclaimer(){
	message = ("Important Information: \n\nThe information included in McGard's application guide is accurate to the best of our knowledge. It is intended only as a reference guide. \n\nDue to the many wheel styles and fasteners available it is the installer's ultimate responsibility to verify that the McGard part is the correct fastener style, thread size and seating surface (flat seat, cone seat, radius seat, shank style, cone-shank style etc.) as recommended by the wheel manufacturer. Minimum thread engagement must be equal to the thread diameter of the wheel stud or lug bolt. \n\nAlways visually verify that the McGard fastener matches the fastener it is replacing. For help with this refer to the Application Verification section in our Catalog/Application Guide, or Customer Service Web page, or call McGard Customer Service at the phone number below. Be sure to read the complete Installation Instructions included with each package prior to installation. \n\nAny application questions should be confirmed by calling McGard Customer Service at 800-444-5847, Monday­Friday, 8am to 5pm Eastern time, or have your McGard products installed by a qualified local retailer/installer of McGard products.\n\nBy clicking 'OK' you acknowledge that you have read and understand the information presented above.");
	check = window.confirm(message);
	if (check) {
		//document.submit();
	} else {
		return false;
	}
}
