$(document).ready(function(){
	$("table#cart tr:even").not(':first-child').addClass('even');
	$("table#cart tr:odd").not(':last-child').addClass('odd');
});

var prev_div='';
function toggle_design(div_id) {
	//alert(div_id)
	document.getElementById(div_id).style.display='';

	 if(prev_div!='')
		 document.getElementById(prev_div).style.display='none';

	prev_div=div_id
}

function reorder(prod_id,temp_id) {
	var xmlContent=document.getElementById(temp_id).value;
	document.forms['reorder_frm'].pid.value=prod_id;
	document.forms['reorder_frm'].temp_id.value=temp_id;
	document.forms['reorder_frm'].xml_content.value=xmlContent;
	document.forms['reorder_frm'].submit();
	
}

var ie4 = false;
if (document.all) { ie4 = true; }
function getObject(id) {
    if (ie4) { return document.all[id]; }
    else { return document.getElementById(id); }
}

//Create a boolean variable to check for a valid MS instance.
var xmlhttp = false;

//Check if we are using IE.
try { //If the javascript version is greater than 5.
    xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) { //If not, then use the older active x object.
    try { //If we are using IE.
        xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
    } catch (E) { //Else we must be using a non-IE browser.
        xmlhttp = false;
    }
}

//If we are using a non-IE browser, create a javascript instance of the object.
if (!xmlhttp && typeof XMLHttpRequest != 'undefined') {
    xmlhttp = new XMLHttpRequest();
}

function myAjaxPost(source, destination, params, ondone) {
    var obj = getObject(destination);
    xmlhttp.open("POST", source, true);
    xmlhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
    xmlhttp.setRequestHeader("Content-length", params.length);
    xmlhttp.setRequestHeader("Connection", "close");
    xmlhttp.onreadystatechange = function () {
        if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
            if (ondone != null) ondone(xmlhttp.responseText);
			else obj.innerHTML = xmlhttp.responseText;
        } else if (xmlhttp.readyState == 4 && xmlhttp.status == 500) {
            obj.innerHTML = xmlhttp.responseText;
        }
    }
    xmlhttp.send(params);
}
