﻿/*******************************************************************************************/
/* Display clock */
/*******************************************************************************************/

function myclock() {
    try {

        var myclock = document.getElementById('myclock');
        var digital = new Date();
        var hours = digital.getHours();
        var minutes = digital.getMinutes();
        var seconds = digital.getSeconds();
        var amOrPm = "πμ";
        if (hours > 11) amOrPm = "μμ";
        if (hours > 12) hours = hours - 12;
        if (hours == 0) hours = 12;
        if (minutes <= 9) minutes = "0" + minutes;
        if (seconds <= 9) seconds = "0" + seconds;
        dispTime = hours + ":" + minutes + ":" + seconds + " " + amOrPm;
        myclock.innerHTML = dispTime;
        setTimeout("myclock()", 1000);
    } catch (Error) { }
}

function mydate() {
    try {

        var myDate = document.getElementById('mydate');
        var myDay = document.getElementById('myday');        
        var digital = new Date();
        var dispdate = "";
        var dispday = "";

        dispdate = digital.format("dd/MM/yyyy");

        switch (digital.getDay()) {
            // email Readings 
            case 1:
                dispday = 'Δευτέρα';
                break;
            case 2:
                dispday = 'Τρίτη';
                break;
            case 3:
                dispday = 'Τετάρτη';
                break;
            case 4:
                dispday = 'Πέμπτη';
                break;
            case 5:
                dispday = 'Παρασκευή';
                break;
            case 6:
                dispday = 'Σάββατο';
                break;
            case 7:
                dispday = 'Κυριακή';
                break;                                                                                                
        }
        
        myDate.innerHTML = dispdate;
        myDay.innerHTML = dispday;
    } catch (Error) {}
}

// Unhide divs with dropdownlists
function DropDownList_visible() {
    document.getElementById('month_sign_month_dropdown').style.display = 'block';
}

function showSWF(filename,w,h,id,flashvars)
{

	var x = id==undefined ? "holder" : id;
	var code = '<object id="'+ x +'" name="'+ x +'" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="'+ w +'" height="'+ h +'">'
	code += '<param name="movie" value="'+ filename +'" />'
	code += '<param name="scale" value="noscale" />'
	code += '<param name="wmode" value="transparent"/>'
	code += '<param name="quality" value="high" />'
	code += '<param name="flashvars" value="'+ flashvars +'"/>'
	code += '<param name="menu" value="0" />'
	code += '<param name="allowScriptAccess" value="always" />'	
	code += '<param name="allowFullScreen" value="true" />'	
	code += '<embed wmode="transparent" id="'+ x +'" name="'+ x +'" flashvars="'+ flashvars +'" menu="0" allowScriptAccess="always" allowFullScreen="true" wmode="transparent" scale="noscale" src="'+ filename +'" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="'+ w +'" height="'+ h +'"></embed></object>'
	document.write(code)
}


function setHomepage() {
    if (document.all) {
        document.body.style.behavior = 'url(#default#homepage)';
        document.body.setHomePage('http://www.e-astro.gr');
    } else if (window.sidebar) {
        if (window.netscape) {
            try {
                netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
            } catch (e) {
            alert("this action was aviod by your browser，if you want to enable，please enter about:config in your address line,and change the value of signed.applets.codebase_principal_support to true");
        }
    }
    var prefs = Components.classes['@mozilla.org/preferences-service;1'].getService(Components.interfaces.nsIPrefBranch);
    prefs.setCharPref('browser.startup.homepage', 'http://www.e-astro.gr'); 
        }
    }


function setAddFavorite() {
    bookmarkurl = "http://www.e-astro.gr";
    bookmarktitle = "e-Astro"
    if (document.all)
        window.external.AddFavorite(bookmarkurl, bookmarktitle)
    else if (window.sidebar) // firefox
        window.sidebar.addPanel(bookmarktitle, bookmarkurl, "");
}


function changemonth(controlno,moving) {
    try {
        var newdsc = '';
	    var current = 0;
	    var newmonth = 0;

        if (controlno == 1)
        {   
            var mymonth = document.getElementById('ctl00_month_sign_month').value;
        }
        
        if (controlno == 2) {
            var mymonth = document.getElementById('ctl00_love_test_cal_month1').value;
        }

        if (controlno == 3) {
            var mymonth = document.getElementById('ctl00_love_test_cal_month2').value;
        }
        
        
	    if (mymonth == 'Ιανουάριος') {
		    current = 1;
	    }

	    if (mymonth == 'Φεβρουάριος') {
		    current = 2;
	    }

	    if (mymonth == 'Μάρτιος') {
		    current = 3;
	    }

	    if (mymonth == 'Απρίλιος') {
		    current = 4;
	    }

	    if (mymonth == 'Μαϊος') {
		    current = 5;
	    }

	    if (mymonth == 'Ιούνιος') {
		    current = 6;
	    }

	    if (mymonth == 'Ιούλιος') {
		    current = 7;
	    }

	    if (mymonth == 'Αύγουστος') {
		    current = 8;
	    }

	    if (mymonth == 'Σεπτέμβριος') {
		    current = 9;
	    }
    	
	    if (mymonth == 'Οκτωβριος') {
		    current = 10;
	    }

	    if (mymonth == 'Νοέμβριος') {
		    current = 11;
	    }

	    if (mymonth == 'Δεκέμβριος') {
		    current = 12;
	    }


	    if (moving == 1) {
	        if (current == 12) {
	            newmonth = 1;
	        }
	        else {
	            newmonth = current + 1;
	        }
	    }

	    else {
	        if (current == 1) {
	            newmonth = 12;
	        }
	        else {
	            newmonth = current - 1;
	        }    
	    }	    
    	
	    switch(newmonth)
            {
                case 1:
                    newdsc = 'Ιανουάριος';
                    break;
                case 2:
                    newdsc = 'Φεβρουάριος';
                    break;
                case 3:
                    newdsc = 'Μάρτιος';
                    break;
                case 4:
                    newdsc = 'Απρίλιος';
                    break;
                case 5:
                    newdsc = 'Μαϊος';
                    break;
                case 6:
                    newdsc = 'Ιούνιος';
                    break;
                case 7:
                    newdsc = 'Ιούλιος';
                    break;
                case 8:
                    newdsc = 'Αύγουστος';
                    break;
                case 9:
                    newdsc = 'Σεπτέμβριος';
                    break;
                case 10:
                    newdsc = 'Οκτωβριος';
                    break;
                case 11:
                    newdsc = 'Νοέμβριος';
                    break;
                case 12:
                    newdsc = 'Δεκέμβριος';
                    break;
            }


            if (controlno == 1) {
                document.getElementById('ctl00_month_sign_month').value = newdsc;
            }

            if (controlno == 2) {
                document.getElementById('ctl00_love_test_cal_month1').value = newdsc;
            }

            if (controlno == 3) {
                document.getElementById('ctl00_love_test_cal_month2').value = newdsc;
            }            
            
    } catch (Error) { }
}


function changeyear(controlno, moving) {
    try {
        var newyear = 0;
        var currentTime = new Date();
        var currentyear = currentTime.getFullYear()
        
        
        if (controlno == 1) {
            var myyear = document.getElementById('ctl00_month_sign_year').value;
        }

        if (controlno == 2) {
           // var myyear = document.getElementById('ctl00_love_test_cal_month1').value;
        }



        if (moving == 1) {
            if (myyear == currentyear) {
                newyear = currentyear;
            }
            else {
                newyear = myyear + 1;
            }
        }

        else {
            if (myyear == 1910) {
                newyear = 1910;
            }
            else {
                newyear = myyear -1;
            }
        }


        if (controlno == 1) {
            document.getElementById('ctl00_month_sign_year').value = newyear;
        }

        if (controlno == 2) {
           // document.getElementById('ctl00_love_test_cal_month1').value = newdsc;
        }

    } catch (Error) { }
}

// Change mouse cursor
function mousechange(MouseType) {
	if (MouseType == 1)
		{
		    document.body.style.cursor = 'pointer';
		}
	else
		{
			document.body.style.cursor = 'default';
		}

}

function gotopage(MyPage) {
    var myUrl = '';

    switch (MyPage) {
        // email Readings
        case 'email_readings':
            myUrl = 'email_readings.aspx';
            break;
        // Testimonials 
        case 'testimonials':
            myUrl = 'testimonials.aspx?Page=0';
            break;
        // Articles and Subjects
        case 'articles_subjects':
            myUrl = 'articles_subjects.aspx';
            break;
        // Articles and Subjects Popular  
        case 'articles_subjects_popular':
            myUrl = 'articles_subjects_popular.aspx';
            break;
        // Articles and Subjects Archive  
        case 'articles_subjects_archive':
            myUrl = 'articles_subjects_archive.aspx';
            break;                        
        // Zodiac list 
        case 'zodiac_list':
            myUrl = 'zodiac_list.aspx';
            break;
        case 'horoscope':
            myUrl = 'horoscope.aspx';
            break;
        // Arithmologia Daily 
        case 'arithmologia_daily':
            myUrl = 'arithmologia_daily.aspx';
            break;            
        // Arithmologia Personal Number  
        case 'arithmologia_personal_number':
            myUrl = 'arithmologia_personal_number.aspx';
            break;
        // Arithmologia Arithmos 
        case 'arithmologia_arithmos':
            myUrl = 'arithmologia_arithmos.aspx';
            break;
        // Tarrot Daily
        case 'tarrot_of_the_day':
            myUrl = 'tarrot_of_the_day.aspx';
            break;
        // Zodia daily
        case 'zodiac_daily':
            myUrl = 'zodiac_daily_list.aspx?typeID=1';
            break;
        // Zodia weekly 
        case 'zodiac_weekly':
            myUrl = 'zodiac_daily_list.aspx?typeID=2';
            break;
        // Zodia monthly  
        case 'zodiac_monthly':
            myUrl = 'zodiac_daily_list.aspx?typeID=3';
            break;
        // Zodia yearly   
        case 'zodiac_yearly':
            myUrl = 'zodiac_daily_list.aspx?typeID=4';
            break;
        // Τarrot free forcast
        case 'tarrot_free_forcast':
            myUrl = 'tarrot_free_forcast.aspx';
            break;
        // Τarrot free forcast 
        case 'tarrot_free_forcast_love':
            myUrl = 'tarrot_free_forcast_love.aspx';
            break;                      
        // Synergates 
        case 'Collaborators':
            myUrl = 'Collaborators.aspx?Category=0&Page=0';
            break;            
        // Live forcast astrology
        case 'partners_astrologia':
            myUrl = 'Collaborators.aspx?Category=1&Page=0';
            break;
        // Live forcast tarrot
        case 'partners_taro':
            myUrl = 'Collaborators.aspx?Category=2&Page=0';
            break;
        // Live forcast arithmologia
        case 'partners_arithmologia':
            myUrl = 'Collaborators.aspx?Category=3&Page=0';
            break;
        // Γενέθλια ανάλυση
        case 'email_reading_No1':
            myUrl = 'email_readings.aspx?CategoryID=1';
            break; 
        // Γενέθλια Ερωτική Συναστρία
        case 'email_reading_No2':
            myUrl = 'email_readings.aspx?CategoryID=2';
            break; 
        // Καρμική Ανάλυση
        case 'email_reading_No3':
            myUrl = 'email_readings.aspx?CategoryID=3';
            break;                                    
        // Home Page 
        case 'home_page':
            myUrl = 'default.aspx';
            break;
        // Terms of use  
        case 'terms_of_use':
            myUrl = 'terms_of_use.aspx';
            break;
        // Faqs  
        case 'faqs':
            myUrl = 'faqs.aspx';
            break;
        // Costs  
        case 'costs':
            myUrl = 'costs.aspx';
            break;
        // Crystal_Ball
        case 'crystal_ball':
            myUrl = 'crystal_ball.aspx';
            break;
        // Mirror 
        case 'mirror':
            myUrl = 'mirror.aspx';
            break;
        // Love Test  
        case 'love_test':
            myUrl = 'love_test.aspx';
            break;
        // Pythia  
        case 'pythia':
            myUrl = 'pythia.aspx';
            break;
        // Communication
        case 'communication':
            myUrl = 'communication.aspx';
            break;                                                    
    }

    document.location = myUrl;

}

// email a friend 
function setemailafriend() {
    window.open('/astrology/email_a_friend.aspx', 'name', 'height=300,width=650,left=100, top=100,resizable=no, scrollbars=no, toolbar=no, status=no');
}

function editpage(page) {

    switch (page) {
        case 'editing_pages_tarot_daily':
            window.open('/astrology/editing/editing_pages_tarot_daily.aspx', 'name', 'height=500,width=800,left=100, top=100,resizable=no, scrollbars=no, toolbar=no, status=no');
            break;
    }
}

// open site
function open_site() {
    window.open('/astrology/Default.aspx');
}

// edit tarrot description
function edittarrotdesc() {
    window.open('/astrology/editing/editing_tarrot_descr.aspx?taro_id=1', 'name', 'height=700,width=800, left=40, top=40, resizable=no, scrollbars=no, toolbar=no, status=no');
}

// edit tarrot description love
function edittarrotdesclove() {
    window.open('/astrology/editing/editing_tarrot_descr_love.aspx?taro_id=1', 'name', 'height=700,width=800, left=40, top=40, resizable=no, scrollbars=no, toolbar=no, status=no');
}

// edit tarrot daily
function edittarrot(taro_daily_id) {
    window.open('/astrology/editing/editing_tarrot_daily.aspx?taro_daily_id=' + taro_daily_id, 'name', 'height=700,width=800, left=40, top=40, resizable=no, scrollbars=no, toolbar=no, status=no');
}

// edit zodiac daily
function editzodiac(zodiac_id) {
    window.open('/astrology/editing/editing_zodiac_daily.aspx?zodiacid=' + zodiac_id, 'name', 'height=700,width=800, left=40, top=40, resizable=no, scrollbars=no, toolbar=no, status=no');
}

// edit zodiac details
function editzodiacprof(zodiac_id) {
    window.open('/astrology/editing/editing_zodiac_details.aspx?zodiacid=' + zodiac_id, 'name', 'height=700,width=800, left=40, top=40, resizable=no, scrollbars=no, toolbar=no, status=no');
}

// edit collaborators details
function editcollaborators(partner_id) {
    window.open('/astrology/editing/editing_collaborators.aspx?partnerid=' + partner_id, 'name', 'height=700,width=800, left=40, top=40, resizable=no, scrollbars=no, toolbar=no, status=no');
}

// edit arithmology
function editarithmology() {
    window.open('/astrology/editing/editing_arithmology_personal.aspx?numbersNo=1', 'name', 'height=700,width=800, left=40, top=40, resizable=no, scrollbars=no, toolbar=no, status=no');
}

// edit arithmology daily
function editarithmologydaily() {
    window.open('/astrology/editing/editing_arithmology_daily.aspx?numbersNo=1', 'name', 'height=700,width=800, left=40, top=40, resizable=no, scrollbars=no, toolbar=no, status=no');
}

// edit aritmology relation
function editarithmologyrelation() {
    window.open('/astrology/editing/editing_arithmology_relation.aspx?numbersNo=1', 'name', 'height=700,width=800, left=40, top=40, resizable=no, scrollbars=no, toolbar=no, status=no');
}

// edit articles and subjects
function editasubjects() {
    window.open('/astrology/editing/editing_articles_subjects.aspx?articles_subjectsID=1', 'name', 'height=700,width=800, left=40, top=40, resizable=no, scrollbars=no, toolbar=no, status=no');
}

// edit emailreadings
function editemailreading(parnerID) {
    window.open('/astrology/editing/editing_email_readings.aspx?email_readingsID=0&partnerID=' + parnerID, 'name', 'height=700,width=840, left=40, top=40, resizable=no, scrollbars=no, toolbar=no, status=no');
}

// edit horoscope
function edithoroscope() {
    window.open('/astrology/editing/editing_horoscope.aspx?horoscopeID=1', 'name', 'height=700,width=800, left=40, top=40, resizable=no, scrollbars=no, toolbar=no, status=no');
}

// partner page
function partnerpage(category, partner) {
    document.location = 'Collaborators_profiles.aspx?Category=' + category + '&CollaboratorID=' + partner + '&Page=0';
}




function menu_visible(menuno) {

    switch (menuno) {
        case 1:
            menu_hidden()
            document.getElementById('menu_collaborators').style.display = 'block';
            break;    
        case 2:
            menu_hidden()
            document.getElementById('menu_astrologia').style.display = 'block';
            break;
        case 3:
            menu_hidden()
            document.getElementById('menu_taro').style.display = 'block';
            break;
        case 4:
            menu_hidden()
            document.getElementById('menu_arithmologia').style.display = 'block';
            break;
        case 5:
            menu_hidden()
            break;
        case 6:
            menu_hidden()
            document.getElementById('menu_astro_fun').style.display = 'block';            
            break;
        case 7:
            menu_hidden()
            break;
    }

}

function menu_hidden() {
    document.getElementById('menu_collaborators').style.display = 'none';
    document.getElementById('menu_astrologia').style.display = 'none';
    document.getElementById('menu_taro').style.display = 'none';
    document.getElementById('menu_arithmologia').style.display = 'none';
    document.getElementById('menu_astro_fun').style.display = 'none';
}


function menu_choose(menuno, myflag) {
    var backcolor = '#3e0a13';
    if (myflag == 1) {
    
        menu_hidden();
        mousechange(1);
        
        switch (menuno) {
            case '0101':
                document.getElementById('menu0101').style.backgroundColor = backcolor;
                document.getElementById('menu_collaborators').style.display = 'block';
                break;
            case '0102':
                document.getElementById('menu0102').style.backgroundColor = backcolor;
                document.getElementById('menu_collaborators').style.display = 'block';
                break; 
                               
            case '0201':
                document.getElementById('menu0201').style.backgroundColor = backcolor;
                document.getElementById('menu_astrologia').style.display = 'block';
                break;
            case '0202':
                document.getElementById('menu0202').style.backgroundColor = backcolor;
                document.getElementById('menu_astrologia').style.display = 'block';
                break;
            case '0203':
                document.getElementById('menu0203').style.backgroundColor = backcolor;
                document.getElementById('menu_astrologia').style.display = 'block';
                break;
            case '0204':
                document.getElementById('menu0204').style.backgroundColor = backcolor;
                document.getElementById('menu_astrologia').style.display = 'block';
                break;
            case '0205':
                document.getElementById('menu0205').style.backgroundColor = backcolor;
                document.getElementById('menu_astrologia').style.display = 'block';
                break;
            case '0206':
                document.getElementById('menu0206').style.backgroundColor = backcolor;
                document.getElementById('menu_astrologia').style.display = 'block';
                break;
            case '0207':
                document.getElementById('menu0207').style.backgroundColor = backcolor;
                document.getElementById('menu_astrologia').style.display = 'block';
                break;
            case '0208':
                document.getElementById('menu0208').style.backgroundColor = backcolor;
                document.getElementById('menu_astrologia').style.display = 'block';
                break;
            case '0209':
                document.getElementById('menu0209').style.backgroundColor = backcolor;
                document.getElementById('menu_astrologia').style.display = 'block';
                break;
            case '0210':
                document.getElementById('menu0210').style.backgroundColor = backcolor;
                document.getElementById('menu_astrologia').style.display = 'block';
                break;  
                              
            case '0301':
                document.getElementById('menu0301').style.backgroundColor = backcolor;
                document.getElementById('menu_taro').style.display = 'block';
                break;
            case '0302':
                document.getElementById('menu0302').style.backgroundColor = backcolor;
                document.getElementById('menu_taro').style.display = 'block';
                break;
            case '0303':
                document.getElementById('menu0303').style.backgroundColor = backcolor;
                document.getElementById('menu_taro').style.display = 'block';
                break;
            case '0304':
                document.getElementById('menu0304').style.backgroundColor = backcolor;
                document.getElementById('menu_taro').style.display = 'block';
                break;
                                                                
            case '0401':
                document.getElementById('menu0401').style.backgroundColor = backcolor;
                document.getElementById('menu_arithmologia').style.display = 'block';
                break;
            case '0402':
                document.getElementById('menu0402').style.backgroundColor = backcolor;
                document.getElementById('menu_arithmologia').style.display = 'block';
                break;
            case '0403':
                document.getElementById('menu0403').style.backgroundColor = backcolor;
                document.getElementById('menu_arithmologia').style.display = 'block';
                break;
            case '0404':
                document.getElementById('menu0404').style.backgroundColor = backcolor;
                document.getElementById('menu_arithmologia').style.display = 'block';
                break;
                                                                
            case '0501':
                menu_hidden()
                break;
                
            case '0601':
                document.getElementById('menu0601').style.backgroundColor = backcolor;
                document.getElementById('menu_astro_fun').style.display = 'block';
                break;
            case '0602':
                document.getElementById('menu0602').style.backgroundColor = backcolor;
                document.getElementById('menu_astro_fun').style.display = 'block';
                break;
            case '0603':
                document.getElementById('menu0603').style.backgroundColor = backcolor;
                document.getElementById('menu_astro_fun').style.display = 'block';
                break;
            case '0604':
                document.getElementById('menu0604').style.backgroundColor = backcolor;
                document.getElementById('menu_astro_fun').style.display = 'block';
                break;                                                
                
            case '0701':
                menu_hidden()
                break;
        }
    }
    else {

        menu_hidden();
        mousechange(2);

        document.getElementById('menu0101').style.backgroundColor = 'Transparent';
        document.getElementById('menu0102').style.backgroundColor = 'Transparent';

        document.getElementById('menu0201').style.backgroundColor = 'Transparent';
        document.getElementById('menu0202').style.backgroundColor = 'Transparent';
        document.getElementById('menu0203').style.backgroundColor = 'Transparent';
        document.getElementById('menu0204').style.backgroundColor = 'Transparent';
        document.getElementById('menu0205').style.backgroundColor = 'Transparent';
        document.getElementById('menu0206').style.backgroundColor = 'Transparent';
        document.getElementById('menu0207').style.backgroundColor = 'Transparent';
        document.getElementById('menu0208').style.backgroundColor = 'Transparent';
        document.getElementById('menu0209').style.backgroundColor = 'Transparent';
        document.getElementById('menu0210').style.backgroundColor = 'Transparent';

        document.getElementById('menu0301').style.backgroundColor = 'Transparent';
        document.getElementById('menu0302').style.backgroundColor = 'Transparent';
        document.getElementById('menu0303').style.backgroundColor = 'Transparent';
        document.getElementById('menu0304').style.backgroundColor = 'Transparent';
        
        document.getElementById('menu0401').style.backgroundColor = 'Transparent';
        document.getElementById('menu0402').style.backgroundColor = 'Transparent';
        document.getElementById('menu0403').style.backgroundColor = 'Transparent';
        document.getElementById('menu0404').style.backgroundColor = 'Transparent';

        document.getElementById('menu0601').style.backgroundColor = 'Transparent';
        document.getElementById('menu0602').style.backgroundColor = 'Transparent';
        document.getElementById('menu0603').style.backgroundColor = 'Transparent';
        document.getElementById('menu0604').style.backgroundColor = 'Transparent';        
    }


}


function closelogin() {
    document.getElementById('login_frame').style.display = 'none';
}

function openlogin() {
    document.getElementById('login_frame').style.display = 'block';
}

function registration() {
    document.location = 'registrations.aspx';
}

function fillspace(mynumber) {
    var i=0;
    var mystring='';
    
    for (i=1; i<=mynumber; i=i+1)
    {
        mystring = mystring + '&nbsp;';
    }

    fillspace = mystring;
    
    return fillspace;
}





var maxZindex = 1000;
var preopen = null;    

function createmonthdrop(){
    this.writeMonthElelements = function (){
        var mycode = '';
        mycode += '<div id="' + this.textbox + '" style="color:#000; width:100px; height:21px; background:url(/astrology/images/field_month.png)">'+ this.defaulttxt +'</div>';
        mycode += '<div id="' + this.arrowsid + '" style="z-index:10000; width:6px; position:absolute; top:2px; left:85px; cursor:hand" onclick="'+ this.stringid +'.showvalues()">';
        mycode += '<img src="/astrology/images/love_test/arrow_up.png" vspace="2" />';
        mycode += '<img src="/astrology/images/love_test/arrow_down.png" />';
        mycode += '</div>';
        mycode += '<input id="'+ this.hiddeninput +'" type="hidden"/>'
        mycode += '<div id="'+ this.dropdown +'" style="z-index:'+ (maxZindex+1) +'; position:absolute; height:100px; overflow:auto; border:solid 1px #DDD; background:#FFF; color:#000; font-size:8pt; width:110px; font-weight:bold; padding:5px; display:none;">';
        mycode += '</div>';
        document.getElementById(this.parentElement).innerHTML = mycode;
    }
this.writedropValues = function (){
     var tarray = new Array; tarray =this.textarray;
     var varray = new Array; varray = this.valuearray;
     for (i=0; i<tarray.length; i++){
        if (i>0) {document.getElementById(this.dropdown).innerHTML += '<br/>';}
                document.getElementById(this.dropdown).innerHTML += '<a class="fonts_arial_black_12" href=javascript:'+ this.stringid +'.putvalues("'+ varray[i] +'","'+ tarray[i] +'")>'+ tarray[i] +'</a>'
         }
}
this.showvalues = function(){
        var valuesdiv = document.getElementById(this.dropdown);
        if (preopen!=this.dropdown && preopen!=null){document.getElementById(preopen).style.display='none'}
        maxZindex = maxZindex+1
        valuesdiv.style.zIndex = maxZindex ;
        if (valuesdiv.style.display=='none'){
                valuesdiv.style.display = 'block';
                valuesdiv.style.top =  '25px' ;
        }
        else {
            valuesdiv.style.display = 'none';
        }
        preopen = this.dropdown ;
}
this.putvalues = function(value,text){
        document.getElementById(this.hiddeninput).value = value ;
        document.getElementById(this.textbox).innerHTML =  '<div style="padding:3px 0px 0px 5px">' + text + '</div>' ;
        this.showvalues();
    }
}			


function createdaydrop(){
    this.writeMonthElelements = function (){
        var mycode = '';
        mycode += '<div id="' + this.textbox + '" style="color:#000; width:45px; height:21px; background:url(/astrology/images/field_day.png)">'+ this.defaulttxt +'</div>';
        mycode += '<div id="' + this.arrowsid + '" style="z-index:10000; width:6px; position:absolute; top:2px; left:30px; cursor:hand" onclick="'+ this.stringid +'.showvalues()">';
        mycode += '<img src="/astrology/images/love_test/arrow_up.png" vspace="2" />';
        mycode += '<img src="/astrology/images/love_test/arrow_down.png" />';
        mycode += '</div>';
        mycode += '<input id="'+ this.hiddeninput +'" type="hidden"/>'
        mycode += '<div id="'+ this.dropdown +'" style="z-index:'+ (maxZindex+1) +'; position:absolute; height:100px; overflow:auto; border:solid 1px #DDD; background:#FFF; color:#000; font-size:8pt; width:45px; font-weight:bold; padding:5px; display:none;">';
        mycode += '</div>';
        document.getElementById(this.parentElement).innerHTML = mycode;
    }
this.writedropValues = function (){
     var tarray = new Array; tarray =this.textarray;
     var varray = new Array; varray = this.valuearray;
     for (i=0; i<tarray.length; i++){
        if (i>0) {document.getElementById(this.dropdown).innerHTML += '<br/>';}
                document.getElementById(this.dropdown).innerHTML += '<a class="fonts_arial_black_12" href=javascript:'+ this.stringid +'.putvalues("'+ varray[i] +'","'+ tarray[i] +'")>'+ tarray[i] +'</a>'
         }
}
this.showvalues = function(){
        var valuesdiv = document.getElementById(this.dropdown);
        if (preopen!=this.dropdown && preopen!=null){document.getElementById(preopen).style.display='none'}
        maxZindex = maxZindex+1
        valuesdiv.style.zIndex = maxZindex ;
        
        if (valuesdiv.style.display=='none'){
                valuesdiv.style.display = 'block';
                valuesdiv.style.top =  '25px' ;
        }
        else {
            valuesdiv.style.display = 'none';
        }
        preopen = this.dropdown ;
}
this.putvalues = function(value,text){

        document.getElementById(this.hiddeninput).value = value ;
        document.getElementById(this.textbox).innerHTML =  '<div style="padding:3px 0px 0px 5px">' + text + '</div>' ;
        this.showvalues();
    }
}			           
function createhoursdrop(){
    this.writeMonthElelements = function (){
        var mycode = '';
        mycode += '<div id="' + this.textbox + '" style="color:#000; width:60px; height:21px; background:url(/astrology/images/field_time.png)">'+ this.defaulttxt +'</div>';
        mycode += '<div id="' + this.arrowsid + '" style="z-index:10000; width:6px; position:absolute; top:2px; left:45px; cursor:hand" onclick="'+ this.stringid +'.showvalues()">';
        mycode += '<img src="/astrology/images/love_test/arrow_up.png" vspace="2" />';
        mycode += '<img src="/astrology/images/love_test/arrow_down.png" />';
        mycode += '</div>';
        mycode += '<input id="'+ this.hiddeninput +'" type="hidden"/>'
        mycode += '<div id="'+ this.dropdown +'" style="z-index:'+ (maxZindex+1) +'; position:absolute; height:100px; overflow:auto; border:solid 1px #DDD; background:#FFF; color:#000; font-size:8pt; width:60px; font-weight:bold; padding:5px; display:none;">';
        mycode += '</div>';
        document.getElementById(this.parentElement).innerHTML = mycode;
    }
this.writedropValues = function (){
     var tarray = new Array; tarray =this.textarray;
     var varray = new Array; varray = this.valuearray;
     for (i=0; i<tarray.length; i++){
        if (i>0) {document.getElementById(this.dropdown).innerHTML += '<br/>';}
                document.getElementById(this.dropdown).innerHTML += '<a class="fonts_arial_black_12" href=javascript:'+ this.stringid +'.putvalues("'+ varray[i] +'","'+ tarray[i] +'")>'+ tarray[i] +'</a>'
         }
}
this.showvalues = function(){
        var valuesdiv = document.getElementById(this.dropdown);
        if (preopen!=this.dropdown && preopen!=null){document.getElementById(preopen).style.display='none'}        
        maxZindex = maxZindex+1
        valuesdiv.style.zIndex = maxZindex ;
        if (valuesdiv.style.display=='none'){
                valuesdiv.style.display = 'block';
                valuesdiv.style.top =  '25px' ;
        }
        else {
            valuesdiv.style.display = 'none';
        }
        preopen = this.dropdown ;
}
this.putvalues = function(value,text){

        document.getElementById(this.hiddeninput).value = value ;
        document.getElementById(this.textbox).innerHTML =  '<div style="padding:3px 0px 0px 5px">' + text + '</div>' ;
        this.showvalues();
    }
}			
//****************************************************************************
var preurl = "";
var url ;
var layer ;
function submitvalues(objarr,myerrorArray){
var objectArray = new Array();
var errorArray = new Array();
var params = new Array();
    objectArray = objarr;
    errorArray = myerrorArray;
    
    for (i=0; i<objectArray.length; i++){
        var controtocheck = '';
        controtocheck = document.getElementById(objectArray[i]);
        if (controtocheck.value == ''){
           
            document.getElementById('errorDisplay').innerHTML = errorArray[i];
            return
        }
        else {
             eval('params['+i+']=' + controtocheck.value); 
        }
        
    }
    document.getElementById('errorDisplay').innerHTML = '';
    getdata('/astrology/templates/data/findHoroscope.aspx?daymonth='+ params[2] + params[3]+'&birthtime=' + params[4] + params[5],'results');
}


function getdata(ourl, olayer) {
if (preurl != ourl)
{
    preurl = ourl ;
    url    = ourl ;
    layer  = olayer ;
    var x = document.getElementById(olayer).clientHeight
    document.getElementById(olayer).innerHTML = '<div align="center" style="margin:'+ (x/2-16) +'px;"><div style="width:15px; height:15px; padding:4px; background:#FFF"><img src="/webtv/images/ProgCircle_32.gif" /></div></div>' ;
    http_request = false;
    if (window.XMLHttpRequest) { 
        http_request = new XMLHttpRequest();
    if (http_request.overrideMimeType) {
        http_request.overrideMimeType('text/html');
    }
    } else if (window.ActiveXObject) { 
      try {
      http_request = new ActiveXObject("Msxml2.XMLHTTP");
    } catch (e) {
    try {
        http_request = new ActiveXObject("Microsoft.XMLHTTP");
    } catch (e) {}
        }
    }
      if (!http_request) {
         alert('Cannot create XMLHTTP instance');
         return false;
      }
      http_request.onreadystatechange = parseHover;
      http_request.open('GET', ourl , true);
      http_request.send(null);
  }
}

function parseHover() {
      if (http_request.readyState == 4) {
         if (http_request.status == 200) {
            document.getElementById(layer).style.display = 'block';
        	document.getElementById(layer).innerHTML = http_request.responseText;
         } 
   }
}
