// for header navigation
function getStockmarketDetails()
{
        var pageURL = "/scripts/cms/getArticleDetails.php?type=stockdetails&page=collection_page";
        var status = new AjaxRequest.get(
        {
                'url':pageURL,
                'onSuccess':function(request){
                var content = request.responseText;
                if( content.length > 0 )
                {
                        if(document.getElementById('stock_market'))
                        document.getElementById('stock_market').innerHTML = content;
                }
                },
                'onError':function(request){
                if(document.getElementById('stock_market'))
                document.getElementById('stock_market').innerHTML = '';
                }
        }
        );
        return;
}
function getStockDetails(){
    if(document.getElementById("txtScript")){
        if(trim(document.getElementById("txtScript").value) == "" || trim(document.getElementById("txtScript").value) == "Get Stock Quote"){
            alert("Please enter your search text");
        }else{
            document.location.href = "/money/src/web/searchScript.php?txtScript="+document.getElementById("txtScript").value+"&quotetype="+document.getElementById("quotetype").value;
        }
    }
}
//Money Quote Details on Homepage
function showMoneyQuoteDetails() {
    var pageURL = "/scripts/cms/getArticleDetails.php?type=money-quotes";
    var status = AjaxRequest.get(
            {
                    'url':pageURL
                    ,'onSuccess':function(req){
                                     content = req.responseText;
                                     document.getElementById('money_quote_details').innerHTML = content;
                            }
                    ,'onError':function(req){ document.getElementById('money_quote_details').innerHTML = '';}
            }
    );
}
function invokeLatestVideo()
{
        return;
        var pageURL = "/scripts/cms/index.php?action=tag-video";
        var status = new AjaxRequest.get(
               {
                       'url':pageURL,
                       'onSuccess':function(req2){
                                        var content = req2.responseText;
                                        if( content.length > 0 )
                                        {
                                                if(document.getElementById('video_on_tag'))
                                                   document.getElementById('video_on_tag').innerHTML = content;
                                        }

                               },
                       'onError':function(req2){
                                        }
               }
        );
        return;

}


//Money Quote Links
var caption = '';
function showMoneyQuotes()
{	
        if(document.getElementById('quote_relatedlink') && document.getElementById('money_com_title') && document.getElementById('money_com_link'))
        {
		
                if(document.getElementById('money_com_title')){
                        var com_title = document.getElementById('money_com_title').innerHTML;
			var temp_title = com_title.split(",");
                }
                if(document.getElementById('money_com_link')){
                        var com_link = document.getElementById('money_com_link').innerHTML;
			var temp_link = com_link.split(",");
                }
                
                var rel_link = '';
		//alert(document.getElementById('money_com_title').innerHTML+'-'+document.getElementById('money_com_link').innerHTML);
                if(com_title != '' && com_link != '' )
                {	var Quote ='';var Link='';var Title='';
			var str = '';
                        for(i=0;i<temp_title.length;i++){
				if(temp_title.length == 1)
					str = temp_title[i];
				else
					str = str+temp_title[i]+",";
			}
			str = str.replace(/,$/,'');
			str = str.replace('&amp;','~');
			//alert(str);
			var pageURL = "/scripts/cms/getArticleDetails.php?type=quote_details&name="+str;
			var status = new AjaxRequest.get(
			       {
				       'url':pageURL,					       					       
				       'onSuccess':function(req2){
						document.getElementById('quote_relatedlink').innerHTML=req2.responseText;
					},					       
				       'onError':function(req2){
						Quote = '';
					}
			       }
			);
                }
        }
}

function dealyShowMoneyTopics(link,title,folder,quote){
	
	
	/*caption += '<div class="quote_relatedlink">All news related to: <a href="'+rel_link+'">'+title+'</a></div>';
	
	
	if(quote != "" && quote != "undefined")
		caption += '<div class="money_quotes">Quotes for:<a href="'+rel_link+'">'+title+'</a> '+quote+' </div><br/>';
	else
		caption += '<div class="money_quotes">Quotes for:<a href="'+rel_link+'">'+title+'</a></div><br/>';*/
	rel_link = '/news/stocks/'+folder+'/';
	qto_link = link+'.html';
	caption += '<div class="moneyweb-evenRowRight">';
        caption += '<div style="float: left; width: 100%; font-size: 16px; color:#000000; font-weight:bold;">'+title+'</div>';
        caption += '<div class="moneyweb-clear"></div>';
	caption += '<div style="float: left; width: 100%; font-size: 14px;"><a href="'+rel_link+'">Related News<a></div>';
	if(quote != "" && quote != "undefined")
		caption += '<div style="float: left; width: 100%; font-size: 14px;"><a href="'+qto_link+'">Quotes</a> '+quote+'</div>';
	else
		caption += '<div style="float: left; width: 100%; font-size: 14px;"><a href="'+qto_link+'">Quotes</a></div>';
	caption += '<div class="moneyweb-clear"></div>';
        caption += '</div>';	
	document.getElementById('quote_relatedlink').innerHTML=req2.responseText;
}

//script for newsletter subscription



function check(){
    var f = document.newsletter_subscribeform;
    var n = f.elements.length;
    for(i=0;i<n;i++) {
        if((f.elements[i].type == "text") && (f.elements[i].value.match(/^\s*$/))){
            alert('Please enter correct emailid without special charecters');
            return false;
        }
    }
        if(!f.email.value.match(/^[\w\_\-\.]+\@[\w\_\-\.]+\.[\w\_\-\.]+$/)){
            alert('Please enter correct email id');
            return false;
        }
            return true;
}


function checkById(){
        if(!document.getElementById('email').value.match(/^[\w\_\-\.]+\@[\w\_\-\.]+\.[\w\_\-\.]+$/)){ 
            alert('Please enter correct email id');
            return false;
        }
            return true;
}


function postform(act,form){
   form.action1.value=act;
   form.method='post';
   if(check()){
      form.submit();
      return true;
   }else{
      return false;
   }
}

function postformById(act,form){
   form.action1.value=act;
   form.method='post';
   if(checkById()){
      form.submit();
      return true;
   }else{
      return false;
   }
}

function selecttext()
{
document.newsletter_subscribeform.email.select()
}
//script for newsletter subscription
function selectTextById()
{
	if(document.getElementById('email').value == 'Enter email id')
		document.getElementById('email').select()
}


//news letter script


function showRelatedTopics()
{
	if(document.getElementById('tags_container'))
	{
		document.getElementById('tags_container').style.display = 'none';
		var tag_output = document.getElementById('tags_container').innerHTML;

		if(document.getElementById('tag_output'))
		{
		        document.getElementById('tag_output').innerHTML = tag_output;
		}
	}
}
function changeFontSize(type){
        var tar_class;
        switch(type){
            case 'small':
                tar_class = 'small';
                break;
            case 'medium':
                tar_class = 'medium';
                break;
            case 'large':
                tar_class = 'large';
                break;
        }
        document.getElementById('story').className=type;
    }

function navigatePrevStories(navigation,record_id)
{
        var self_url = document.location.href;
        var pageURL = "/scripts/cms/getArticleDetails.php?record_id="+record_id+"&type=prev_story&source_url="+self_url;
        var status = new AjaxRequest.get(
               {
                       'url':pageURL,
                       'onSuccess':function(req2){
                                        var content = req2.responseText;
                                        if( content.length > 0 )
                                        {
                                                if(document.getElementById('previous_story'))
                                                   document.getElementById('previous_story').innerHTML = content;
                                        }

                               },
                       'onError':function(req2){
                                                if(document.getElementById('previous_story'))
                                                        document.getElementById('previous_story').innerHTML = 'Server is busy. Try later!';
                                        }
               }
        );

        return;
}
function navigateNextStories(navigation,record_id)
{
        var self_url = document.location.href;
        var pageURL = "/scripts/cms/getArticleDetails.php?record_id="+record_id+"&type=next_story&source_url="+self_url;
        var status = new AjaxRequest.get(
               {
                       'url':pageURL,
                       'onSuccess':function(req1){
                                        var content = req1.responseText;
                                        if( content.length > 0 )
                                        {
                                                if(document.getElementById('next_story'))
                                                        document.getElementById('next_story').innerHTML = content;
                                        }

                               },
                       'onError':function(req1){
                                                if(document.getElementById('next_story'))
                                                        document.getElementById('next_story').innerHTML = 'Server is busy. Try later!';
                                        }
               }
        );

        return;
}


var cur_id,pre_id;
var right_cur_id,right_pre_id;
var pre_color = '';

function showSlide( id)
{
	var content_slide = '';
	var tab_id = '';
	var cur_class = '',pre_class = '';

	content_slide = "contentslide_";
	tab_id = "linktab_";
	cur_class = "onclick_red";
	pre_class = "onclick_blue";

        cur_id = id;
        if(document.getElementById(content_slide+cur_id))
        {
                document.getElementById(content_slide+cur_id).style.display = 'block';
                document.getElementById(tab_id+cur_id).className = cur_class;

        }
        if( cur_id != pre_id )
        if(document.getElementById(content_slide+pre_id))
        {
                document.getElementById(content_slide+pre_id).style.display = 'none';
                document.getElementById(tab_id+pre_id).className = pre_class;
        }

        else
        {
                pre_id = '1';
                if( cur_id != pre_id )
                {
                        document.getElementById(content_slide+pre_id).style.display = 'none';
                        document.getElementById(tab_id+pre_id).className = pre_class;
                }

        }


        pre_id = cur_id;

        return;
}
function showRightSlide( id,cur_color,new_color,default_color )
{
	var color = '';
        var content_slide = '';
        var bg = '',arrow = '';
        var tab_id = '';
        content_slide = "rightslide_";
        tab_id = "clicktab_";
        bg = "bg_";
        arrow = "arrow_";
        color = 'color_';
	
	if(pre_color == '')
		pre_color = default_color;

        right_cur_id = id;
        if(document.getElementById(content_slide+right_cur_id))
        {
                document.getElementById(content_slide+right_cur_id).style.display = 'block';
                document.getElementById(bg+right_cur_id).style.backgroundColor = new_color;
                document.getElementById(arrow+right_cur_id).style.color = '#FFFFFF';
                document.getElementById(arrow+right_cur_id).style.backgroundColor = new_color;
		document.getElementById(arrow+right_cur_id).style.backgroundImage = "url(/img/arrow-down.gif)";
		document.getElementById(arrow+right_cur_id).style.backgroundRepeat = 'no-repeat';
		document.getElementById(arrow+right_cur_id).style.backgroundPosition = 'left center';
		document.getElementById(color+right_cur_id).style.backgroundColor = new_color;
        }
        if( right_cur_id != right_pre_id )
        if(document.getElementById(content_slide+right_pre_id))
        {
                document.getElementById(content_slide+right_pre_id).style.display = 'none';
                document.getElementById(bg+right_pre_id).style.backgroundColor = cur_color;
                document.getElementById(arrow+right_pre_id).style.backgroundColor = cur_color;
                document.getElementById(color+right_pre_id).style.backgroundColor = pre_color;                
		document.getElementById(arrow+right_pre_id).style.backgroundImage = "url(/img/brn-arrow-side.gif)";
                document.getElementById(arrow+right_pre_id).style.color = '#AB2E36';
		document.getElementById(arrow+right_pre_id).style.backgroundPosition = 'left center';
		document.getElementById(arrow+right_pre_id).style.backgroundRepeat = 'no-repeat';
        }
        else
        {
                right_pre_id = '1';
                if( right_cur_id != right_pre_id )
                {
                        document.getElementById(content_slide+right_pre_id).style.display = 'none';
		        document.getElementById(bg+right_pre_id).style.backgroundColor = cur_color;
		        document.getElementById(arrow+right_pre_id).style.backgroundColor = cur_color;
		        document.getElementById(color+right_pre_id).style.backgroundColor = pre_color;       
			document.getElementById(arrow+right_pre_id).style.backgroundImage = "url(/img/brn-arrow-side.gif)";
                	document.getElementById(arrow+right_pre_id).style.color = '#AB2E36';
			document.getElementById(arrow+right_pre_id).style.backgroundRepeat = 'no-repeat';
			document.getElementById(arrow+right_pre_id).style.backgroundPosition = 'left center';
                }

        }

        right_pre_id = right_cur_id;
	pre_color = new_color;

        return;
}


function invokeDidUMiss( category_id,category_name ) // for the category_id
{
       var pageURL = "/scripts/cms/getArticleDetails.php?category_id="+category_id+"&type=did-u-miss&category_name="+category_name;
       var status = AjaxRequest.get(
               {
                       'url':pageURL
                       ,'onSuccess':function(req){
                                        var content = req.responseText;
					//alert(content);
					if( content.length > 0 )
					{
						document.getElementById('did-u-miss').innerHTML = content;
					}
                                       
                               }
                       ,'onError':function(req){ document.getElementById('did-u-miss').innerHTML = '';}
               }
       );

	return;

}


function invokeOnLine( html_id )
{
	if(document.getElementById(html_id))
		html_id = html_id;
	else
		html_id = html_id.id;
	
	var index = document.getElementById(html_id).selectedIndex;
	var story_tag = document.getElementById(html_id).options[index].text;
	//story_tag = escape(story_tag);
	//story_tag = story_tag.replace("+", "%2B");
    	//story_tag = story_tag.replace("/", "%2F");
	var self_url = window.location.href;
	var category_name = self_url.split('/')[3];
	//document.charSet = 'UTF-8';
	var pageURL = "/scripts/cms/getArticleDetails.php?tag_name="+story_tag+"&type=latest-story&tag_index="+index+"&category_name="+category_name;
	//alert(pageURL);

	//alert(pageURL);
	var status = AjaxRequest.get(
			{
			'url':pageURL
			,'onSuccess':function(req){
			var content = req.responseText;
			//alert(content);
			if( content.length > 0 )
			{
			document.getElementById('latest_story').innerHTML = content;
			}

			}
			,'onError':function(req){ document.getElementById('latest_story').innerHTML =''; }
			}
			);
	return;
}


// New Right Include JS Ends



var cur_id = '';
var pre_id = '';


function showClickin( id )
{
	var content_slide = "clickinslide_";
        var tab_id = "linktab_";
        cur_id = id;
        if(document.getElementById(content_slide+cur_id))
        {
                document.getElementById(content_slide+cur_id).style.display = 'block';

        }
        if(document.getElementById(content_slide+pre_id))
        {
                document.getElementById(content_slide+pre_id).style.display = 'none';
        }

        else
        {
                pre_id = '1';
                if( cur_id != pre_id )
                {
                        document.getElementById(content_slide+pre_id).style.display = 'none';
                }

        }

	pre_id = cur_id;
	
	return;
}

function showSlide( id )
{
	var content_slide = "contentslide_";
	var tab_id = "linktab_";
	cur_id = id;
	if(document.getElementById(content_slide+cur_id))
	{
		document.getElementById(content_slide+cur_id).style.display = 'block';
		document.getElementById(tab_id+cur_id).className = "onclick_red";
		
	}
	if( cur_id != pre_id )
	if(document.getElementById(content_slide+pre_id))
	{
		document.getElementById(content_slide+pre_id).style.display = 'none';
		document.getElementById(tab_id+pre_id).className = "onclick_blue";
	}
		
	else
	{
		pre_id = '1';
		if( cur_id != pre_id )
		{
			document.getElementById(content_slide+pre_id).style.display = 'none';
			document.getElementById(tab_id+pre_id).className = "onclick_blue";
		}
		
	}
		
	
	pre_id = cur_id;
	
	return;
}




function activateTab(id, mod, no_tabs) {
    for (var i=1; i<=no_tabs; i++) {
        if  (p_o(mod+"_tc"+i)) {
            if (id == i) {
                p_o(mod+"_tc"+i).style.display = "block";
                p_o(mod+"_t"+i).className= "active";
            } else {
                p_o(mod+"_tc"+i).style.display = "none";
                p_o(mod+"_t"+i).className = "";
            }
        }
    }
}

var toFcs=null;
function p_o(o){return document.getElementById(o);}
function showTab(did,cid,cback){
    if(did==null)return false;
    var div=p_o(did);
    var tab=p_o(cid);
    if(tab==null)return false;
    var tabs=div.childNodes;
    for(var i=0;i<tabs.length;i++){
        if(tabs[i].nodeType==1&&tabs[i]!=tab){
            tabs[i].className='dn';
        }
    }
    tab.className='di';
    if(cback!=null)eval(cback);
    fcs();
}
function mkTab(did,cid,htm){
    var div=p_o(did);
    if(div==null)return;
    var newT=false;
    var tab=p_o(cid);
    if(!tab){
        tab=document.createElement('div');
        tab.setAttribute('id',cid);
        newT=true;
    }
    tab.className='dn';
    tab.innerHTML=htm;
    if(newT)div.appendChild(tab);
}
function allLI(arg) {
    if (p_o(arg)) {
        if (tablisttag==null)tablisttag='li';
        var x = p_o((arg)).getElementsByTagName(tablisttag).length;
        while (x>0) {
            if (p_o((arg+x)))p_o((arg+x)).className="";
            if (p_o((arg+'a'+x)))p_o((arg+'a'+x)).className="";
            x--;
        }
    }
}
function selTab(arg,i){
    if(arg!=null){
        allLI(arg);
        lidx = (arg +i);
        liadx = (arg+'a'+i);
    }
    if(arg == 'r'){
        p_o(lidx).className="curr";
    }else if(arg!=null){
        if (p_o(lidx))p_o(lidx).className="over";
        if (p_o(liadx)){
            if(dlscheme[i]){
                p_o(liadx).className="sel "+ dlscheme[i];
            }else{
                p_o(liadx).className="sel";
            }
        }
    }
}
function pGet(url,i,arg,id,cback,frce,fcsId){
    var cid=id+i;
    toFcs=fcsId;
    if((frce!=null&&frce)||showTab(id,cid,cback)==false){
        var uid=(new Date()).getTime();
        url+='&uid='+uid+'&cid='+cid;
        if(arg!=null)url+='&targ='+arg;
        if(i!=null)url+='&tid='+i;
        if(cback!=null)url+='&cback='+escape(cback);
    }else{
        selTab(arg,i);
    }
}
function fcs(id){
    if(id==null){
        if(toFcs==null)return;
        id=toFcs;
    }
    var o=p_o(id);
    toFcs=null;
    if(!o)return;
    if(o.getAttribute("tabIndex")==null){
        switch(o.nodeName.toLowerCase()){
            case 'a':
            case 'body':
            case 'button':
            case 'frame':
            case 'iframe':
            case 'img':
            case 'input':
            case 'object':
            case 'select':
            case 'textarea':
                break;
            default:
                o.setAttribute("tabIndex","-1");
                break;
        }
    }
    if(o.focus){
        if(document.all){
            o.focus();
            o.focus(); 
        }else{
            setTimeout('p_o("' + o.id + '").focus()', 0);
        }
    }
}
function ae(o,et,fn){
    var x;
    if(x=o.addEventListener)x(et,fn,0);
    else if(x=o.attachEvent){
        o['e'+et+fn]=fn;
        o[et+fn]=function(){o['e'+et+fn](window.event);}
        x('on'+et,o[et+fn]);
    }
}
function omo(id){
    s_objectID=id;
}

var colorscheme='';
var dlscheme = new Array();
var c=0;
var tkr='';
var dlini=false;
var to=null;
var pto=null;
var dlnum=1;
var nDls=1;
var dlnext = new Array();
var dldur=80;
var dllast;
var qfcs;
var troflags = new Array();
var dlpops = new Array();
var pd;
var psed=false;
var fitab='';
var pctrl_flag = 1;

function dlinit(){
    if(dlini)return;
    dlini=true;
    to=setTimeout('dlgo()',getdldur(dlnum));
    if(p_o('pt'+dlnum))pt();
}
function pt(){
    if(!pd)return;
    c++;
    if(c==pd.length)c=0;
    pto=setTimeout('pt()',3000);
}
function dlf(){
    if(pctrl_flag == 1) {
        p_o('dlpi').className="dlpi";
        pctrl_flag = 0;
    } else
        psed = true;
    return dlgo('FWD');
}
function dlb(){return dlgo('BAK')}
function dlgo(typ,num){
    var fcsId='dlC';
    dlini=true;
    dllast=dlnum;
    switch(typ){
        case 'NUM':
            if(dlnum==num)return false;
            clrT();
            dlnum=num;
            psed=true;
            break;
        case 'BAK':
            clrT();
            dlnum--;
            psed=true;
            break;
        case 'FWD':
            clrT();
            dlnum++;
            break;
        default:
            if(!psed) dlnum++;
            fcsId=null;
            break;
    }
    if(dlnum>nDls){
        dlnum=1;
    }else if(dlnum<1){
        dlnum=nDls;
    }
    if(nDls!=1){
        var pUrl = '';
        if(dlpops['dl'+dlnum]) {
            pUrl += '&dlitem='+dlpops['dl'+dlnum];
        }
        pGet('',dlnum,'dlt','dlC','dlc()',null,fcsId);
    }

    if (p_o("dyn_sqrblock")) {
        for (var i=1; i<=nDls; i++) {
            if (p_o("dl_sqr"+i)) {
                if (i == dlnum)
                    p_o("dl_sqr"+i).style.background = "#FFF";
                else
                    p_o("dl_sqr"+i).style.background = "#BABABA";
            }
        }
    }
    setPse();
    return false;
}
function dlc() {
    dlteaser();
    dlcnt();
    if(!psed){
        to=setTimeout('dlgo()',getdldur(dlnum));
    }
}
function dlcnt() {
    if (p_o('dlcount')) {
        p_o('dlcount').innerHTML = dlnum + '/' + nDls;
    }
}
function dlteaser() {
    if (p_o('dlnext')) {
        if (dlnum == nDls) {
            nextDL = 1;
        } else {
            nextDL = dlnum + 1;
        }
        if (dlnext[nextDL]) {
            p_o('dlnext').innerHTML = dlnext[nextDL];
        } else {
            p_o('dlnext').innerHTML = '';
        }
    }
}
function dlblr() {
    qfcs=0;
}
function dlfcs() {
    qfcs=1;
}
function dlp(){
    if(psed){
        psed=false;
        to=setTimeout('dlgo()',getdldur(dlnum));
    }else{
        psed=true;
        clrT();
    }
    setPse();
    return false;
}
function setPse(){
    if(!p_o('dlpi'))return;
    if(psed){
        p_o('dlpi').className="dlpi_off";
    }else{
        p_o('dlpi').className="dlpi";
    }
}





function track(id,once) {
    if(!(o=p_o(id)))return;
    if(once && troflags[id]){
        return;
    }
    var d=o.innerHTML;
    var urls=d.split(",");
    if(once)troflags[id] = 1;
}
function clrT(){
    if(to){
        clearTimeout(to);
    to=null;
    }
}

ae(window,'load',dlinit);

function getdldur(dlnum) {
    if (o=p_o('dlcyc'+dlnum)) {
        return (o.innerHTML * 1500);
    }
    return dldur;
}

function getUserCityAndCountry(sub_frm)
{
        var self_url = document.location.href;
        var pageURL = "/scripts/cms/getArticleDetails.php?type=get-city";
        var status = new AjaxRequest.get(
               {
                       'url':pageURL,
                       'onSuccess':function(req2){
									var content = req2.responseText;
									content_arr = content.split("-!@#-");
									city = content_arr[0];
									country = content_arr[1];
									document.getElementById('newsletter_city').value = city;
									document.getElementById('newsletter_country').value = country;
									sub_frm.submit();
                               },
                       'onError':function(req2){}
               }
        );

        return false;
}
function trim(str){
        if (str == null){return ("");}
        return str.replace(/(^\s+)|(\s+$)/g,"");
}

//For flowers.oneindia promo
function loadFlowers() {
	var pageURL = "/scripts/cms/flower-promo.php";
	var status = AjaxRequest.get(
		{
			'url':pageURL,
			'onSuccess':function(req){ document.getElementById('flower_holder').innerHTML = req.responseText; }, 'onError':function(req){ }
		}
	);
  return status;
}


//For flowers.oneindia promo
function loadSplFlowers() {
    var pageURL = "/scripts/cms/flower-special-promo.php";
    var status = AjaxRequest.get(
        {
            'url':pageURL,
            'onSuccess':function(req){ document.getElementById('flower_spl_holder').innerHTML = req.responseText; }, 'onError':function(req){ }
        }
    );
  return status;
}

//For Astrology promo
function loadAstroPromo() {
	var pageURL = "/scripts/cms/astro-img-promo.php";
	var status = AjaxRequest.get(
		{
			'url':pageURL,
			'onSuccess':function(req){ document.getElementById('astro_holder').innerHTML = req.responseText; }, 'onError':function(req){ alert('Error!\nStatusText='+req.statusText+'\nContents='+req.responseText); }
		}
	);
  return status;
}


//to load js,css files dynamically when flights manual search block appears
function loadFlightsPromotionsJS(flightPromoType){



 if(flightPromoType =='fm'){

 var headID = document.getElementsByTagName("head")[0];
var newScript = document.createElement('script');
newScript.type = 'text/javascript';
newScript.src = 'http://travel.oneindia.in/flights/js/jquery.min.js';
headID.appendChild(newScript);

var headID = document.getElementsByTagName("head")[0];
var newScript = document.createElement('script');
newScript.type = 'text/javascript';
newScript.src = 'http://travel.oneindia.in/flights/js/jquery-ui.min-promotions.js';
headID.appendChild(newScript);

var headID = document.getElementsByTagName("head")[0];
var cssNode = document.createElement('link');
cssNode.type = 'text/css';
cssNode.rel = 'stylesheet';
cssNode.href = 'http://travel.oneindia.in/flights/css/jquery-ui-promotions.css';
cssNode.media = 'screen';
headID.appendChild(cssNode);

    } else {

 var headID = document.getElementsByTagName("head")[0];
var newScript = document.createElement('script');
newScript.type = 'text/javascript';
newScript.src = 'http://travel.oneindia.in/flights/js/jquery.min.js';
headID.appendChild(newScript);
    }

}

//jS function For flights promotions
function loadFlightsPromotions() {
    var pageURL = "/scripts/cms/flights-promo.php";
    var status = AjaxRequest.get(
        {
            'url':pageURL,
            'onSuccess':function(req){ document.getElementById('flights_promotions').innerHTML = req.responseText;
        if(document.getElementById('flightpromoID')){
        var flightPromoType = document.getElementById('flightpromoID').value;
            if(flightPromoType =='fm'){
                
                loadFlightsPromotionsJS(flightPromoType);
            } else {
                loadFlightsPromotionsJS('fb');
            }
        }
        
        }, 'onError':function(req){ }
        }
    );
  return status;
}


