/***********************************************
* Drop Down/ Overlapping Content- © Dynamic Drive (www.dynamicdrive.com)
* This notice must stay intact for legal use.
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/
function checkCode(){
	var ccoin= document.ccoin.ccoincode.value;
	var ccCodes = new Array("86753","4658","4049","4418","11201","14468","30547","31144","32680","14078","36440","40110","40147","40498","40604","40698","41013","41174","41186","44104","47406","48691","49080","49843","49854","Z449A","9804S","56981","60484","60890","62111","65047","65088","65449","65984","65988","69404","69548","69877","77448","80544","90870","98065","98652","98804","99801","104984","113014","250544","350850","359804","401489","404111","404770","405409","406498","409844","498836","504994","508404","540446","602301","604004","605585","606003","630404","630524","649504","650489","650498","650980","654477","658503","689706","890403","905040","905640","959980","980420","980474","980512","980805","980950","1010612","3046504","3394983","3665454","4046060","4064940","4090809","4980463","6046060","6050448","7077880","2523877","1049046P","108FT6","16X6544","3030154A","3694A","40148AG","40166A","4018W1","40440A","40640A","411A447","44804R","460A460A","4680A1","48469F","5050A","604499G","605055A","6055A","6065A","6404D","650447A","65048Q","6504A","65094AA4","6509AW","650AXG","654049A","65984A","659874AX","6598A5","6804F","69A466","70504A","77980A","7904A","874A48","87874D","8980S4A","9804S","AA1014","ADS6040","AS46A","D5485S","DF405","FG65G6","G4654A","G65AD","H8547","MP1453","MP4154","OP893","R4874","W650G","X6569");
	var validCode= false;
	for (i=0; i != ccCodes.length; i++) {
		var codeStr= ccCodes[i];
		if (codeStr.toUpperCase() == ccoin.toUpperCase()) {
			validCode = true;
			finalObject.usedCode=true;
			break;
		}

	}
	
	if (validCode==true){
	var temp = new Array();
		temp = imgFinal.src.split('.jpg');
		imgFinal.src=temp[0] + "_bw.jpg";
	
		window.open(matiasFinalUrl,'_blank');
	}else{
	document.ccoin.ccoincode.value="Invalid Code";	
	}


return false;
}
function getposOffset(overlay, offsettype){
var totaloffset=(offsettype=="left")? overlay.offsetLeft : overlay.offsetTop;
var parentEl=overlay.offsetParent;
while (parentEl!=null){
totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
parentEl=parentEl.offsetParent;
}
return totaloffset;
}

function overlay(curobj, subobjstr, opt_position, finalUrl, img){
	var imgObj=document.getElementById(img)

imgFinal=imgObj
matiasFinalUrl=finalUrl
finalObject=imgObj

	
if (finalObject.usedCode==true){
	window.open(matiasFinalUrl,'_blank');
	}else{
	

	document.ccoin.ccoincode.value="";
	if (document.getElementById){
		
		var subobj=document.getElementById(subobjstr)
		subobj.style.display=(subobj.style.display!="block")? "block" : "none"
		var xpos=getposOffset(curobj, "left")+((typeof opt_position!="undefined" && opt_position.indexOf("right")!=-1)? -(subobj.offsetWidth-curobj.offsetWidth) : 0) 
		var ypos=getposOffset(curobj, "top")+((typeof opt_position!="undefined" && opt_position.indexOf("bottom")!=-1)? curobj.offsetHeight : 0)
		subobj.style.left=xpos+"px"
		subobj.style.top=ypos+"px"
		
		
		return false
	}
	else
		return true
	}
}

function overlayclose(subobj){
document.getElementById(subobj).style.display="none"
}
