/*
 *	Sea Venture LLC 
 *	Main Javascript	
 *	(C)2010 Sea Venture LLC
 */

function nothing() {
	var xmlhttp=null;
	return xmlhttp;
}

$(document).ready(function() {
	// buy now button
	$('.buynow').hover(function() { //mouse in
		$(this).find('span').animate({ opacity: '0' }, 400);
	}, function() { //mouse out
		$(this).find('span').animate({ opacity: '1' }, 400);
	});
	
	// dl button
	$('.download').hover(function() { //mouse in
		$(this).find('span').animate({ opacity: '0' }, 400);
	}, function() { //mouse out
		$(this).find('span').animate({ opacity: '1' }, 400);
	});
});

//language
function OnChange(dropdown)
{
    var myindex  = dropdown.selectedIndex;
    var newurl="";
    switch (myindex) {
    	case 0:
    		newurl="http://www.iheartrhythm.com/";
    		break;
		case 1:
    		newurl="http://www.iheartrhythm.com/esp/";
    		break;
		case 2:
    		newurl="http://www.iheartrhythm.com/fr/";
    		break;
		case 3:
    		newurl="http://www.iheartrhythm.com/jpn/";
    		break;
		case 4:
    		newurl="http://www.iheartrhythm.com/chn/";
    		break;
    	default:
    		newurl="http://www.iheartrhythm.com/";
    		break;
    }
    		
    top.location.href = newurl;
    return true;
}

function LimitText(AId,BId) {
	var e1 = document.getElementById(AId);
	var e2 = document.getElementById(BId);
	var l1 = e1.value.length;
	(l1 > 300)?e1.value = e1.value.substring(0,300):e2.innerHTML = 300 - l1 
}





