/* Author : Jaison
     Create Date:Dec 12,2011
     Module: The functionality of this javascript file is to set the valuein the browser cookie and the duration of its expiry.

*/
// set form values to browser cookie and its time duration of existance in browser.
function Set_Cookie( name, value, expires, path, domain, secure )
{

	// set time, it's in milliseconds
	var today = new Date();
	today.setTime( today.getTime() );
	if ( expires )	{
		expires = expires * 1000 * 60 * 60 * 24;
	}
	var expires_date = new Date( today.getTime() + (expires) );

	document.cookie = name + "=" +escape( value ) +
	( ( expires ) ? ";expires=" + expires_date.toGMTString() : "" ) +
	( ( path ) ? ";path=" + path : "" ) +
	( ( domain ) ? ";domain=" + domain : "" ) +
	( ( secure ) ? ";secure" : "" );
	
}

// setCookie calls Set_Cookie methods for setting the duration of cookie in browser
function setCookie(){
	
	Set_Cookie( 'mmoName', document.getElementById("mmoName").value, '100', '/', '', '' );
	Set_Cookie( 'mmoEmail', document.getElementById("mmoEmail").value, '100', '/', '', '' );
	Set_Cookie( 'mmoCompany', document.getElementById("mmoCompany").value, '100', '/', '', '' );
	Set_Cookie( 'mmoTitle', document.getElementById("mmoTitle").value, '100', '/', '', '' );
	Set_Cookie( 'mmoEmailMarketingInd', document.getElementById("mmoEmailMarketingInd").value, '100', '/', '', '' );


}

function setTrackingCookie(name, value){
	
	Set_Cookie( name, value, '1', '/', '', '' );
	

}



